httr (version 1.0.0)

url_ok: Check for an http OK status.

Description

Checks if a request on a given URL succeeds and returns an OK status.

Usage

url_ok(...)

Arguments

...
passed to HEAD to perform the request (usually just a url)

Value

  • This function returns TRUE only if the http status is exactly 200, FALSE otherwise. See http://en.wikipedia.org/wiki/Http_status_codes for more information on http status codes.

See Also

Other response methods: content, parsed_content, text_content; http_error, stop_for_status, warn_for_status; http_status; response; url_success

Examples

Run this code
url_ok("http://www.google.com")
url_ok("http://httpbin.org/status/200")
url_ok("http://httpbin.org/status/201")

Run the code above in your browser using DataCamp Workspace