Rebol - HTTP response headers

2019-07-22 03:56发布

问题:

Where does Rebol (R2) save the HTTP response headers after a call to the read function (which just seems to return the page content)?

回答1:

Not sure there is an easy way to get the headers after a straight read.

You can get them if you open a port:

hp: open http://www.rebol.com
probe hp/locals/headers
    make object! [
        Date: "Sat, 07 May 2011 07:08:35 GMT"
        Server: "Apache"
        Last-Modified: "Tue, 22/Feb/2011/06:52:26/+GMT"
        Accept-Ranges: "bytes"
        Content-Encoding: none
        Content-Type: "text/html"
        Content-Length: "9062"
        Location: none
        Expires: none
        Referer: none
        Connection: "close"
        Authorization: none
    ]