Learn R Programming

gym (version 0.1.0)

parse_server_error_or_raise_for_status: Parse the server error or raise for status.

Description

Parse the server error or raise for status.

Usage

parse_server_error_or_raise_for_status(response)

Arguments

response
A response object from httr::POST or httr::GET.

Value

If the response code is 200 or 204, a parsed response. Else, a server error or raised exception.

Examples

Run this code
## Not run: 
# b2 <- "http://httpbin.org/post"
# response <- httr::POST(b2, body = "A simple text string")
# parse_server_error_or_raise_for_status(response)
# ## End(Not run)

Run the code above in your browser using DataLab