httr (version 0.3)

url_success: Check for an http success status.

Description

Checks if a request on a given URL succeeds.

Usage

url_success(...)

Arguments

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

Value

  • This function returns TRUE if the request succeeds (status in the 200s), 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_ok

Examples

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

Run the code above in your browser using DataCamp Workspace