Jump to content

HTTP status


EVD

Recommended Posts

When I catch HTTP headers with the Live HTTP Headers plugin in Firefox I get some information that I'd like to catch with ASP:

http://w3schools.invisionzone.com/GET / HTTP/1.1Host: w3schools.invisionzone.comUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: en-us,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Proxy-Connection: keep-aliveHTTP/1.x 200 OKProxy-Connection: Keep-AliveConnection: Keep-AliveTransfer-Encoding: chunkedVia: 1.1 CATFISHDate: Fri, 21 Sep 2007 12:33:36 GMTContent-Type: text/htmlServer: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7aX-Powered-By: PHP/4.4.7Set-Cookie: pass_hash=b7c137b2b16aeabd31b0a5fdd200e18e; expires=Friday, 28-Sep-07 12:33:36 GMT; path=/Set-Cookie: session_id=30b621fc02c5424fafda16ba3273661e; path=/Keep-Alive: timeout=10, max=150

With the obvious code I can retrieve most of them in ASP, but not all. I am especially interested in catching the HTTP/1.x 200 OK -bit. Any idea atyone, on how to retrieve the HTTP status code?

Link to comment
Share on other sites

The response code is not sent by the browser, the response code is sent by the server to the browser (as the response, hence the name). So ASP doesn't have access to any response headers because when the ASP code is running the response headers have not been sent yet, the server usually waits until ASP is finished to send any headers, unless you flush the response buffer before then. You can send your own response headers, but it wouldn't make sense for the ASP page to read the response headers just because they haven't been sent yet.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...