Ok, ill try to answer my own question. Yes, its against the the RFCs,
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Note: RFC 1945 and RFC 2068 specify that the client is not allowed
to change the method on the redirected request
So I just overrode the isRedirect() method and returned True when a POST and
a redirect were happening and everything works fine.
-Ryan
On Tue, Oct 12, 2010 at 11:47 PM, Ryan Smith <[email protected]>wrote:
> Hello,
>
> I am using HttpClient 4.1-alpha2 and I am coming across a web server that
> takes a POST method request, but sends back a 302 temp redirect.
>
> After checking the DefaultRedirectStrategy code, line 83, I noticed that
> POSTs wont redirect. (probably breaks an RFC?)
>
> switch (statusCode) {
> case HttpStatus.SC_MOVED_TEMPORARILY:
> return (method.equalsIgnoreCase(HttpGet.METHOD_NAME)
> || method.equalsIgnoreCase(HttpHead.METHOD_NAME)) &&
> locationHeader != null;
>
> So since Firefox, MSIE, etc take redirects from a POST and do a GET on the
> redirected location uri, how would I go about doing that in HttpClient? I
> figured I'd ask here before hacking & patching.
>
> Thank you.
>
> -Ryan
>
>
>