Hi, I'm not sure, but is this also acceptable for SOAP services? if the xml-data in the POST request are too big for a GET request...? Of course a SOAP server shouldn't answer with a 302 status code, right?
Christian Shahar Evron wrote: > > Hi, > > It seems that wget, curl and Firefox all handle 301 and 302 responses > just like 303 responses: by dropping the POST data and sending a GET > request to the new location. > > My suggestion is that we do the same by default, optionally adding the > option to resend POST data when redirecting on 301/302 responses. > > Shahar. > > > > Gavin Vess wrote: >> Shahar, >> >> What do wget, curl, and lftp do for these situations? >> >> For example, try something like: >> >> wget -S --post-data="data_to_post" http://www.your_test_server.com/ >> >> The "-S" option will >> Cheers, >> Gavin >> >> Shahar Evron wrote: >>> Hi, >>> >>> I am not entirely sure about how the new Zend_Http_Client (in the >>> incubator) should handle redirections. >>> >>> Right now, if you send a POST request, with POST parameters, and get a >>> redirection, the same request (POST) will be sent to the new location. >>> >>> The RFCs clearly say that POST requests should not be redirected >>> without the user's approval. On the other hand, from the RFC (2616): >>> >>> Note: RFC 1945 and RFC 2068 specify that the client is not allowed >>> to change the method on the redirected request. However, most >>> existing user agent implementations treat 302 as if it were a 303 >>> response, performing a GET on the Location field-value regardless >>> of the original request method. The status codes 303 and 307 have >>> been added for servers that wish to make unambiguously clear which >>> kind of reaction is expected of the client. >>> >>> I'm a bit confused of how to handle these situations. The way I see >>> it, these are the options: >>> >>> 1. When redirecting, reset all parameters (get and post) and send a >>> GET request to the new location >>> >>> 2. When redirecting, send the same request to the new location - >>> regardless of the request type or parameters. >>> >>> 3. Add some flag to the HTTP client - so the user will be able to >>> choose whether to redirect to GET requests or not. >>> >>> Opinions and advice is most welcome >>> >>> BTW - I'd appreciate any comments about the new design and >>> implementation of the incubator HTTP client (and other classes) - I >>> was expecting to get bashed when I commited it but got nothing ;) >>> >>> Shahar. >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Redirection-handling-in-the-new-HTTP-client-tp4641869s16154p15020099.html Sent from the Zend Framework mailing list archive at Nabble.com.
