in reply to Posting Form with LWP Produces 'no-cache, must revalidate' Error

Let's see now... certain amount of guesswork in places, but for what it's worth...

First, it's not an error message as such, it's a normal http response. It says at the start that it's HTTP/1.1, so let's have a look at the RFC... Looks like RFC 2616, Hypertext Transfer Protocol -- HTTP/1.1 is the one you want.

Next bit of the response: 302 Found. This is covered in section 10.3.2 of the RFC, and a bit higher up it explains that all the 3xx codes are to do with redirection. 302 found means that The requested resource resides temporarily under a different URI.

Now The temporary URI SHOULD be given by the Location field in the response. So it looks like this is a redirection from your original request, /controlcenter/, to /controlcenter/?u=100000&p=0x1000000000000 - interesting(ish).

(The bit you were worried about, Cache-Control: no-cache, must-revalidate, just indicates that this response shouldn't be cached).

Now LWP can, afair, follow redirections for you if you tell it to, but it can't in this case even if you *do* tell it to, because If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. - and our request was, of course, a POST, so the LWP module "MUST NOT" (this is RFC-language for "really really shouldn't, we mean it") follow the redirection automatically.

So what could you do?

I've been into this point-by-point not out of any intention to be patronising, but to assist those monks who might not have come across the RFCs before - they can be v.useful.

hth, andy.

  • Comment on HTTP/1.1 302 Found Re: Posting Form with LWP Produces 'no-cache, must revalidate' Error
  • Select or Download Code