ropenscilabs/fauxpas

Name: fauxpas

Owner: rOpenSci

Owner: rOpenSci Labs

Description: fauxpas does http errors

Created: 2016-04-13 20:33:33.0

Updated: 2018-01-02 14:30:23.0

Pushed: 2018-01-08 15:25:59.0

Homepage:

Size: 60

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

fauxpas

Build Status cran version rstudio mirror downloads

fauxpas does http errors

Info Links:

Install

CRAN version

all.packages("fauxpas")

Dev version

ools::install_github("ropenscilabs/fauxpas")

ary("fauxpas")
use with crul
ary("crul")
<- HttpClient$new("https://httpbin.org/status/414")
<- cli$get()
(res)
rror: Request-URI Too Long (HTTP 414).
414(res)
rror: Request-URI Too Long (HTTP 414).

 HTTPRequestURITooLong$new()
_verbose(res)
rror: Request-URI Too Long (HTTP 414).
 The server is refusing to service the request because the Request-URI is
  longer than the server is willing to interpret. This rare condition is only likely
  to occur when a client has improperly converted a POST request to a GET request
  with long query information, when the client has descended into a URI black hole
  of redirection (e.g., a redirected URI prefix that points to a suffix of itself),
  or when the server is under attack by a client attempting to exploit security
  holes present in some servers using fixed-length buffers for reading or
  manipulating the Request-URI.
use with curl
ary("curl")
 curl::new_handle()
::handle_setopt(h)
 <- curl::curl_fetch_memory("https://httpbin.org/status/404", h)
(resp)
rror: Not Found (HTTP 404).
404(resp)
rror: Not Found (HTTP 404).

 HTTPNotFound$new()
_verbose(resp)
rror:  Not Found (HTTP 404).
- The server has not found anything matching the Request-URI. No indication is
iven of whether the condition is temporary or permanent. The 410 (Gone) status
ode SHOULD be used if the server knows, through some internally configurable
echanism, that an old resource is permanently unavailable and has no forwarding
ddress. #> This status code is commonly used when the server does not wish to
eveal exactly why the request has been refused, or when no other response is
pplicable.
use with httr
ary("httr")
<- GET("https://httpbin.org/status/405")
405(res)
rror: Method Not Allowed (HTTP 405).

 HTTPMethodNotAllowed$new()
_verbose(res)
rror: Method Not Allowed (HTTP 405).
- The method specified in the Request-Line is not allowed for the resource
dentified by the Request-URI. The response MUST include an Allow header
ontaining a list of valid methods for the requested resource.
Meta

rofooter


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.