cURL / Mailing Lists / curl-library / Single Mail

curl-library

POST after the first POST returned 303

From: Andrei Cipu <acipu_at_ixiacom.com>
Date: Fri, 30 Mar 2012 11:10:02 +0000

Hi,

Currently libCURL assumes that if a POST request returns HTTP code 303, the follow-up must be a GET request. It even has a funny comment in the code: " doing a second POST when following isn't what anyone would want!". However, RFC 2616 states [1] that " a different URI [...] SHOULD be retrieved using a GET method on that resource" (only SHOULD, not MUST). As it turns out, there are servers out there that want a POST after they returned 303 to a previous POST request.

The patch in the following email adds another value (CURL_REDIR_POST_303) for the CURLOPT_POSTREDIR option, allowing the user to send 2 consecutive POSTs.

Regards,
  Andrei Cipu

[1] http://tools.ietf.org/html/rfc2616#section-10.3.4

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-30