Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Net.httpStatus

Net.httpStatus($url, $headers={}) -> number

Description

Send an HTTP HEAD request and return the three-digit HTTP status code.

$url must be a URL TypeString.

If the hostname can not be found, the returned status will be 0.

To check if a URL is ok to fetch, status should be 200.

Net.httpStatus(url'https://example.com')
//= 200

Net.httpStatus(url'https://example.com/bad-path')
//= 404

Net.httpStatus(url'https://non-existent.blah')
//= 0