Net.httpHead
Net.httpHead($url, $requestHeaders={}) -> map
Description
Send an HTTP HEAD request and return a map of response headers.
$url must be a URL TypeString.
Returned Values
| Key/Type | Description |
|---|---|
status |
Numeric HTTP status code |
raw |
Raw list of HTTP headers |
| (date string) | Date object |
Net.httpHead(url'http://example.com')
//= {
// status: 200
// contentEncoding: 'gzip'
// lastModified: 《 Date 2019-10-17 07:18:26 +0000 》
// contentLength: 648
// connection: 'close'
// ...
// raw: [
// 'HTTP/1.1 200 OK'
// 'Content-Encoding: gzip'
// 'Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT'
// 'Content-Length: 648'
// 'Connection: close'
// ...
// ]
// }
In case of an error, it will return an empty Map.
Net.httpHead(url'https://non-existent.blah')
//= {}