cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Option for forcing POST after redirect

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 10 Sep 2007 15:48:38 +0200 (CEST)

On Mon, 10 Sep 2007, euphrate_ylb wrote:

> As introduced in this previous thread (
> http://curl.haxx.se/mail/archive-2007-09/0030.html), I think curl should
> support an option for allowing people to post data even after a redirection.
> Such an option would be especially useful for developer that are not using
> curl directly (via another library) and don't want to execute any curl
> command.

Uh, hang on. I'd like to get more technical on this. I can see how we can add
an option that would make libcurl act RFC2616-like on a HTTP 302 response. I'm
not seeing how much good can come from a "always post on redirect" option - as
that would very easily cause major havoc.

> Ex: In PHP the PEAR::SOAP library relies on curl for HTTPS. Therefore you
> can setup options for curl but you don't neet to execute directly curl
> commands.

Surely (I hope) they rely on libcurl?

> This option may be something like '--force-post' or something based on
> '--location-...'.

Those are curl command line options, and this is the libcurl list so we rather
speak of libcurl options here.

I think I could do with an option like CURLOPT_STRICTSTANDARD that takes a
bitmasked argument where we can add bits for what parts we want libcurl to be
(more) strict about standards and less conforming to what browsers and other
clients do. Like this:

#define CURL_STRICT_ALL (0xffffffff) /* makes libcurl super-strict */
#define CURL_STRICT_HTTP302 (1<<0) /* do POST again after HTTP 302 */

curl_easy_setopt(handle, CURLOPT_STRICTSTANDARD, CURL_STRICT_HTTP302);

I believe there are a few other choices done in the library than then could
get a bit added here and thus let applications alter how libcurl acts.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-09-10