Skip to contents

Sends a GET for the first byte, so that the answer carries the resource's headers without the resource; a HEAD is not used because some servers answer it differently.

Usage

probe(url, clearance = NULL)

Arguments

url

The URL.

clearance

A clearance from clearance(), to probe as the browser that earned it; NULL probes as a plain client.

Value

A list: reachable, status (NA when unreachable), challenged (is_challenge()), blocked (is_block()), type (the content-type, lower case), size (bytes, from content-range or content-length, NA when unknown) and headers (a named list). A browser is called for when challenged or blocked is TRUE.

Examples

if (FALSE) { # \dontrun{
probe("https://www12.statcan.gc.ca/census-recensement/index-eng.cfm")
} # }