rt (version 1.0.1)

rt_parse_response: Parse an RT response in its parts as a list

Description

The RT API uses overrides default HTTP behavior with their own set of status codes, messages, and response formats. This function parses that custom implementation and presents it into something that's easier to build a package with.

Usage

rt_parse_response(response, verbose = FALSE)

Arguments

response

(character) Parsed response from content

verbose

(logical) Optional, defaults to TRUE. Prints more information during parsing.

Value

(list) List with named elements status, message, and body

Details

For example, a response like:

"RT/4.4.3 200 Ok

# Ticket 2 created.

is turned into the list:

$status
[1] 200

$message [1] "Ok"

$body [1] "# Ticket 2 created."