HTTP 3xx response
Daniel Neri
daniel.neri@REDACTED
Mon Nov 6 19:12:13 CET 2000
Peter Andersson <Peter.Andersson@REDACTED> writes:
> When you get an HTTP 3xx (e.g. 302) response which indicates a URI
> redirection, it states in RFC1945 that you will get a reference to
> the new URL in the "entity body" of the response.
Actually you'll get the new location in the "Location" header of the
response. The reference included in the body is typically just a
hyperlink, in case the client software cannot handle the redirection
automatically.
Real world (almost) example:
,----
| $ telnet foo.example.org http
| Trying 10.10.10.10...
| Connected to foo.example.org.
| Escape character is '^]'.
| GET / HTTP/1.0
| Host: foo.example.org
|
| HTTP/1.1 302 Found
| Date: Mon, 06 Nov 2000 17:47:49 GMT
| Server: Apache/1.3.9 (Unix) PHP/3.0.11 mod_ssl/2.4.9 OpenSSL/0.9.4
| Location: http://www.example.com/bar
| Connection: close
| Content-Type: text/html
|
| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
| <HTML><HEAD>
| <TITLE>302 Found</TITLE>
| </HEAD><BODY>
| <H1>Found</H1>
| The document has moved <A HREF="http://www.example.com/bar">here</A>.<P>
| <HR>
| <ADDRESS>Apache/1.3.9 Server at foo.example.org Port 80</ADDRESS>
| </BODY></HTML>
`----
(Names and IPs have been changed to protect the innocent ;-)
Best wishes,
--Daniel
--
Daniel Neri mailto:dn@REDACTED
Sigicom AB, Sweden http://www.sigicom.com
More information about the erlang-questions
mailing list