info(“httpheaders”)
info(“httpheaders”)

The info(“httpheaders”) function returns a dictionary with information about a just completed HTTP download.

Description

This function returns a dictionary with information about a just completed HTTP download. To do this, the first statement in the urltask( completion code should be the urltaskstatus function. Then at a later point, the code can use the info(“httpheaders”) function to get a dictionary that contains all of the available information about the download. The exact dictionary entries will vary depending on the server queried, but here is a typical example.

        Server=Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8l PHP/5.3.3
        Connection=Keep-Alive
        Etag="4e6c5-b60f-4e4f0aea25200"
        Keep-Alive=timeout=15, max=499
        Content-Type=text/html
        X-Frame-Options=SameOrigin
        Expires=Thu, 09 Oct 2014 08:53:21 GMT
        Cache-Control=max-age=60
        Accept-Ranges=bytes
        Last-Modified=Tue, 27 Aug 2013 16:51:20 GMT
        Date=Thu, 09 Oct 2014 08:52:21 GMT
        MS-Author-Via=DAV
        Content-Length=46607

If you only need the header information and not the data itself, set the `METHOD` to `HEAD`. For example you might want to do this to verify that a resource exists without taking the time to download the whole thing.

See Also

- encodehttppostdata( -- converts a dictionary into HTTP post data.
- info("urltaskinfo") -- returns information about a just completed HTTP download.
- ipaddress -- returns the current IP address of the computer, or "" if not connected.
- loadurl -- loads a resource from the internet.
- loadurl( -- loads a resource from the internet.
- posturl -- loads a resource from the internet, with form data.
- posturl( -- loads a resource from the internet, with form data.
- url( -- synchronously loads a resource from the internet.
- urltask( -- asynchronously loads a resource from the internet.
- urltaskcancel -- aborts a download initiated with the urltask( function.
- urltaskstatus -- enables connection error checking in urltask( completion code.
- zipinfo -- queries the web to obtain information about a zip code.
- zipinfoplus -- queries the web to obtain information about a zip code.

History

Version | Status | Notes
10.0 | New | New in this version.