cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to capture http response number?

From: Kman Devnull <kman.devnull_at_gmail.com>
Date: Tue, 17 May 2016 15:11:21 +0100

Hi Daniel,
Thanks - this works.

Now, I see that if the server was slow to respond to a http-post, it
appears that my whole code seems to wait on the call-back function
"WriteMemoryCallback".

My embedded system, speaks to various sensors - now because of the above
delay, it affects the real-time processing/receiving of the sensor data.
How would you propose for me to proceed?

Is there a way I could make the receiving of server-response -parallel-(as
in another thread etc.) to sending of the http_post?

thanks.

On Thu, Apr 21, 2016 at 11:03 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 21 Apr 2016, Kman Devnull wrote:
>
> After the line,
>> result = curl_easy_perform(curl);
>>
>> the server returns a "response" something like 291236 - I just want to be
>> able to capture this and print it in my log.
>>
>
> Retrieve the response in a buffer and check that? Like the getinmemory.c
> example perhaps?
>
> https://curl.haxx.se/libcurl/c/getinmemory.html
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-17