cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting the HTTP response code following a 100 Continue

From: Jorge Velázquez <jorge.velazquez_at_gmail.com>
Date: Mon, 14 Mar 2011 16:00:58 -0700

Olivier is correct, this is what I am seeing, also. In order to view the
final status code, I had to implement a header function and manually parse
out the 2nd response code when the request is completed. Since, per the
spec, a final status code is required in all cases, as far as I can tell, it
seems reasonable to make the 2nd response code the value returned from
CURLINFO_RESPONSE_CODE in all cases. In my usage of Expect: 100-Continue,
the client doesn't really care about the 100 response (other than to trigger
the actual upload), it seems to be mostly for the benefit of the server in
order to preemptively cancel a request that it knows it will ultimately
reject.

On Mon, Mar 14, 2011 at 3:19 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 23 Feb 2011, Olivier Lebra wrote:
>
> When a server returns HTTP code 100 followed by a 200 (or 404, etc.),
>> CURLINFO_RESPONSE_CODE is set to 100. Is there a way to get the second HTTP
>> code?
>>
>
> (Sorry for not having responded earlier, I had completely missed this
> mail.)
>
> Hm, the way I read the code you should rather only get the later code and
> not the 100... What version of libcurl are you using? I should probably
> write/check a test case to verify my reading.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> 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 2011-03-15