On Tue, Apr 09, 2002 at 03:58:29PM +0900, Antony Stace wrote: > What is an easy way to see the HTTP headers in a HTTP request. I want to see things >like > > HTTP/1.1 200 OK > Date; Fri, 30 Oct 1998 13:12:23 GMT > Server: Apache/1.3.3 (Unix) > Cache-Control: max-age=1800, must-revalidate
In the apache logs? At the client (browser) end? Over the network? Your question is confusing because you use the term "HTTP request" then paste what appears to be a response to an "HTTP request". Are you after the response or the request. As for how to make apache show this info in logs, I'm not sure, however... To pretend to be a browser you can conveniently use netcat (nc) to simulate the connection (or just telnet to the server) eg: $ telnet localhost 80 Trying 127.0.0.1... Connected to localhost.localdomain. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 403 Forbidden Date: Tue, 09 Apr 2002 07:07:07 GMT (blah, blah) To pretend to be a server you can always use netcat (nc) with the -l flag: $ nc -l -p 1234 Then with your browser: http://host.running.netcat:1234/ then you'll see: GET / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* Accept-Language: ie-ee,en-au;q=0.7,is;q=0.3 Accept-Encoding: gzip, deflate (blah, blah) Or you can simply use tcpflow to sniff the application data from a tcp session, eg: tcpflow -ieth0 host host.of.your.browser and port 80 on your web server or any intermediate network device or network device that can listen promiscuously on another part of your network. Then you will get files of the form: a.b.c.d.port-e.f.g.h.80 and e.f.g.h.80-a.b.c.d.port where a.b.c.d is the client ip and port is the client port number (arbitrary) and e.f.g.h is the server ip. Sorry if I've been a bit terse, if you need me to elaborate let me know. Regards, Chris -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
