EVOLUTION-MANAGER
Edit File: http_status.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Give information on the status of a request.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for http_status {httr}"><tr><td>http_status {httr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Give information on the status of a request.</h2> <h3>Description</h3> <p>Extract the http status code and convert it into a human readable message. </p> <h3>Usage</h3> <pre> http_status(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a request object or a number.</p> </td></tr> </table> <h3>Details</h3> <p>http servers send a status code with the response to each request. This code gives information regarding the outcome of the execution of the request on the server. Roughly speaking, codes in the 100s and 200s mean the request was successfully executed; codes in the 300s mean the page was redirected; codes in the 400s mean there was a mistake in the way the client sent the request; codes in the 500s mean the server failed to fulfill an apparently valid request. More details on the codes can be found at <code style="white-space: pre;">http://en.wikipedia.org/wiki/Http_error_codes</code>. </p> <h3>Value</h3> <p>If the status code does not match a known status, an error. Otherwise, a list with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>category</code></td> <td> <p>the broad category of the status</p> </td></tr> <tr valign="top"><td><code>message</code></td> <td> <p>the meaning of the status code</p> </td></tr> </table> <h3>See Also</h3> <p>Other response methods: <code><a href="content.html">content</a>()</code>, <code><a href="http_error.html">http_error</a>()</code>, <code><a href="response.html">response</a>()</code>, <code><a href="stop_for_status.html">stop_for_status</a>()</code> </p> <h3>Examples</h3> <pre> http_status(100) http_status(404) x <- GET("http://httpbin.org/status/200") http_status(x) http_status(GET("http://httpbin.org/status/300")) http_status(GET("http://httpbin.org/status/301")) http_status(GET("http://httpbin.org/status/404")) # errors out on unknown status ## Not run: http_status(GET("http://httpbin.org/status/320")) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>httr</em> version 1.4.2 <a href="00Index.html">Index</a>]</div> </body></html>