LibCurl Question

@Mike_Duglas, do you have an example of sending a json object to a secure rest api at all using LibCurl?


Ps. Dare I say, C6.3 :slight_smile:

Usually this code works: Q. I need to send json string.

That’s what I’ve tried, but I’ll try again tomorrow.

Use DebugView utility to analyze client-server packets if you think that something goes wrong.

No matter how I try and send the json object I’m just getting a failed response from the server, and DebugView shows the correct information being sent in DATA_OUT :frowning:

Foget that, I have something now, I found some Curl code an converted that, but now I’m going to have a look at why it didn’t do it beforehand, but I think I may know. Just going to check something…

Response message could shed a light on the reason why the server rejects the request.

I had added HttpHeaders but didn’t call SetHttpHeaders, so I’m getting a response now.

Quickie, I think I know the answer to confirm, I can pass in a XML object can’t I, afterall it is just a string once again?

Sure no matter json it is or xml.

Can I get the reponse code from respBuffer at all?

Many servers return an error in the form of something like “{‘error’:12345, ‘message’:‘description’}”, so use cjson to parse json response.