Package-internal HTTP-response helper
Source:R/manual_layer_responses.R
dot-get_raw_response_body_or_stop.Rd
This is a package-internal function for code-deduplication within various manual-layer functions.
Arguments
- resultObject
Should be a return value from an API function which uses
.wrap_as_api_response
internally. These are functions which are manually edited after OpenAPI autogen.
Value
The argument, as long as it's of type raw
. Else, stops. The
caller can then decode the raw body.
Details
For the API-level functions which use .wrap_as_api_response
,
manual-layer functions will receive either (a) the raw HTTP body,
if the status_code
was 2xx, or (b) an ApiResponse
object. Using this function, callsites can get the HTTP body (if
available), else an informative stop()
.