How do I connect to this webservice ?

I have been reading the documentation of the WS… and it says that using CURL this is the correct way to connect…

curl https://api.blahblah.com/v201408/json/HelloWorld -d ‘json={“Hello”:“World”}’

PostContentTextArea.text = {“Hello”:“World”}
TF_URL.Text = https://api.blahblah.com/v201408/json/HelloWorld

I tried with the following code… but I get nothing

dim hsock as new HTTPSecureSocket hsock.Secure = True hsock.setPostContent PostContentTextArea.text, "application/json" dim content as string = hsock.post(TF_URL.Text, 30)

Any ideas ?

not seeing where you are using cURL here

I am not… I want to avoid it… that’s where my problem is…

I just want to connect without using cURL… if I try with cURL from command line, I get a response, but I am not sure how to do it 100% Xojo code…

if you are on the Mac, you can use PAWS to help figure out how to use the web service (REST API) and you can have PAWS create the Xojo code.

Maaaaaybe you could actually post which API you’re using?
You know, so we could read the docs and help you out.

Also, the link for Paw: http://paw.cloud
(+1 recommendation for Paw to debug)

Hey Scott… unfortunately I don’t have a mac available…

@Tim Parnell : Defintely !! http://myallocator.github.io/apidocs/#api-3_API_Methods-HelloWorld

HTTPSecureSocket is HTTP 1.0 so perhaps that’s the issue? Try using Xojo.Net.HTTPSocket.
I am not the response I expected with Paw, but rather a “no json parameter received” error so there may be other factors causing issues. The fact that you’re getting absolutely nothing as a response feels like a HTTP 1.0/1.1 issue though.

Well YES. A fast test showed you are right Tim. Dropping the secure connection got me some data back (the error code)

At least I am connecting now… not sure if they support not secure connections, though…

But thanks!!!

The examples all show https, so I would think they’re using secure connections. The old HTTPSocket isn’t the greatest with newer web technologies and APIs (because it’s HTTP 1.0) Xojo.Net.HTTPSocket handles secure connections for you, uses the system level proxy settings, and a whole bag of other neat tricks so you may want to switch this to the new framework.