Learn R Programming

rapiclient (version 0.1.8)

result_handlers: Simple functions to handle http response

Description

When creating operations from api one can define how the response from http should be handled. These functions can be used for simple result handling.

Usage

content_or_stop(x)

content_or_warning(x)

content_or_message(x)

Value

Content of http response

Arguments

x

A response object from httr package (see response object in httr package documentation)

Functions

  • content_or_warning(): Returns content or issues a warning

  • content_or_message(): Returns content or prints a message

Details

See get_operations for details.

Examples

Run this code
api_file <- system.file(
  "extdata", "sample_specs", "petstore.yaml",
  package = "rapiclient", mustWork = TRUE
)
api <- get_api(api_file)
operations <- get_operations(api, handle_response = content_or_stop)

Run the code above in your browser using DataLab