OCI REST for ESP32
Public Member Functions | Public Attributes | List of all members
ociApiResponse Struct Reference

Contains the response from an API call. More...

#include <oci.h>

Public Member Functions

 ociApiResponse (Header *responseHeaders={}, int responseHeaderCount=0)
 Construct a response with an array of headers and the count. More...
 
 ociApiResponse (String response, int statusCode, String opcRequestId, String errorMsg, Header *responseHeaders={}, int responseHeaderCount=0)
 Construct a full response object. More...
 

Public Attributes

String response
 The string returned from the API call. Usually JSON.
 
int statusCode
 The HTTP status code returned.
 
String opcRequestId
 The opc-request-id
 
String errorMsg
 Any error message returned from the API call.
 
HeaderresponseHeaders
 An array of headers to collect from the API call.
 
int responseHeaderCount
 The count of headers to collect.
 

Detailed Description

Contains the response from an API call.

Pass an array of Header objects if you want to retrieve headers sent back from the API.

Constructor & Destructor Documentation

◆ ociApiResponse() [1/2]

ociApiResponse::ociApiResponse ( Header responseHeaders = {},
int  responseHeaderCount = 0 
)
inline

Construct a response with an array of headers and the count.

Parameters
responseHeadersAn array of headers (name only)
responseHeaderCountThe count of headers in the array

◆ ociApiResponse() [2/2]

ociApiResponse::ociApiResponse ( String  response,
int  statusCode,
String  opcRequestId,
String  errorMsg,
Header responseHeaders = {},
int  responseHeaderCount = 0 
)
inline

Construct a full response object.

Used internally.

Parameters
responseThe response text
statusCodeThe HTTP status code. Ex. 200.
opcRequestIdThe opc-request-id.
errorMsgThe error returned from the API
responseHeadersAn array of headers (name only)
responseHeaderCountThe count of headers in the array

The documentation for this struct was generated from the following file: