cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch for 301/302 redirect after post

From: Martin Drasar <drasar_at_optimsys.cz>
Date: Thu, 17 Jul 2008 08:12:37 +0200

Dan Fandrich napsal(a):
> On Mon, Jul 14, 2008 at 05:11:32PM +0200, Martin Drasar wrote:
>> Hi curl devs,
>> I have created a patch that lets user to chose a way to handle redirect
>> after 301 or 302.
>> CURLOPT_POST301 is changed from bool to long
>> CURLOPT_POST302 (long) is added
>> These two options set the behavior in such way:
>> -1: error is reported after post followed by 301/302
>> 0: post is resent
>> 1: post is changed to get
>
> One thought just came to me--is the new "-1" option even needed? How is it
> different from disabling redirects altogether and letting the application
> check the return code for 301 or 302 itself?
>
>>>> Dan

Because I don't want to disable redirects. I still want curl to follow
307. This new option is needed so that my platform can tell the customer
- "hey, your system is broken. Follow the standards at once" easily.
Without this I have no other way to find and report that customer's
system is using 302 (which causes GET everytime) where he should be
using 307, other than by examining the response I get (which could be
PITA) or by disabling redirects and hadnling them by myself...

Martin

-- 
   Martin Drasar, Developer / Analyst
   OptimSys, s.r.o.
   drasar_at_optimsys.cz
   Tel: +420 541 143 065
   Fax: +420 541 143 066
   http://www.optimsys.cz
Received on 2008-07-17