Skip to contents

Parses and standardizes API responses from Pinecone into a consistent format.

Usage

handle_respons(response, tidy = FALSE)

Arguments

response

An httr response object from a Pinecone API call.

tidy

Logical. If TRUE, returns only the parsed content instead of the full response structure. Default is FALSE.

Value

A list with three components:

http

The raw httr response object

content

Parsed response content (NULL if status code is not 200)

status_code

HTTP status code of the response

If tidy = TRUE, returns only the parsed content directly.

Examples

if (FALSE) { # \dontrun{
response <- httr::GET("https://api.pinecone.io/indexes")
result <- handle_respons(response)
result$status_code
result$content
} # }