default_response_handler: Default Response Handler

View source: R/api-client.R

default_response_handlerR Documentation

Default Response Handler

Description

Default callback function for processing API response content. This function converts data frames within lists to data.table objects for better performance and functionality, if the data.table package is available.

Usage

default_response_handler()

Details

The function recursively processes list responses and converts any data.frame objects to data.table objects using data.table::as.data.table(), but only if the data.table package is installed. If data.table is not available, data frames are returned unchanged. Non-data.frame elements are always returned unchanged.

Value

A function that accepts parsed response content and returns processed content

Examples

# Get the default handler
handler <- default_response_handler()

# Use with a custom handler
custom_handler <- function(content) {
  # Your custom processing logic
  content
}


azr documentation built on Feb. 18, 2026, 1:07 a.m.