curl-library
Re: header functions and error response headers
Date: Tue, 28 May 2013 14:09:57 +0300
On Mon, May 27, 2013 at 09:27:49PM -0500, David Strauss wrote:
> On Mon, May 27, 2013 at 11:33 AM, Mohammad_Alsaleh <msal_at_tormail.org> wrote:
> > Am I doing something wrong?
>
> Instead of expecting it as a header, you should read the code using
> curl_easy_getinfo() with CURLINFO_RESPONSE_CODE [1], assuming
> curl_easy_perform() returns CURLE_OK.
>
> [1] http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFORESPONSECODE
>
I had code for this already.
And why assuming CURLE_OK?
The response is probably more important when e.g.
CURLE_HTTP_RETURNED_ERROR is returned. And unless
I'm missing something, that seems to be handled just fine.
But this not what I asked anyway.
What I'm actually trying to achieve is reading the error message
servers sometimes send with the response.
Any pointers on how to achieve that?
> --
> David Strauss
> | david_at_davidstrauss.net
> | +1 512 577 5827 [mobile]
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-28