Class CprApiClient
Defined in File CprApiClient.h
Page Contents
Inheritance Relationships
Base Type
public axr::sdk::net::IApiClient
(Class IApiClient)
Class Documentation
-
class CprApiClient : public axr::sdk::net::IApiClient
Implementation of the IApliClient using the C++Requests (CPR) HTTP library.
Public Functions
-
virtual ~CprApiClient()
Initiates an HTTP request to the remote server for the given path and method.
- Parameters
path – The resource path to send the request to.
method – The HTTP method to use in the request.
queryParams – The query parameters to add to the path.
postBody – The message body to send to the remote server.
headerParams – The set of headers to attach to the request.
contentType – The content type of the request.
- Returns
The response encoded as a string.
-
virtual pplx::task<utility::string_t> SendForm(const utility::string_t &path, const HttpMethod method, const std::map<utility::string_t, utility::string_t> &formParams, const std::map<utility::string_t, utility::string_t> &queryParams, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP request to send a multi-part form to the remote server for the given path and method.
- Parameters
path – The resource path to send the request to.
method – The HTTP method to use in the request.
formParms – The set of HTTP form parameters to attach to the request.
queryParams – The query parameters to add to the path.
headerParams – The set of headers to attach to the request.
- Returns
The response encoded as a string.
Initiates an HTTP request to send a set of files to the remote server for the given path and method.
- Parameters
path – The resource path to send the request to.
method – The HTTP method to use in the request.
queryParams – The query parameters to add to the path.
file – The set of file parameters to attach to the request.
headerParams – The set of headers to attach to the request.
contentType – The content type of the request.
- Returns
The response encoded as a string.
-
virtual pplx::task<void> Delete(const utility::string_t &path, const std::map<utility::string_t, utility::string_t> &queryParams, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP DELETE request at the given path.
- Parameters
path – The path to the remote resource to delete.
queryParams – The set of query parameters to append to the path.
headerParams – The set of headers to attach to the request.
-
virtual pplx::task<Variant> Get(const utility::string_t &path, const std::map<utility::string_t, utility::string_t> &queryParams, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP GET request at the given path.
- Parameters
path – The path to the remote resource to retrieve.
queryParams – The set of query parameters to append to the path.
headerParams – The set of headers to attach to the request.
- Returns
The response encoded as a JSON object.
-
virtual pplx::task<std::uint64_t> Head(const utility::string_t &path, const std::map<utility::string_t, utility::string_t> &queryParams, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP HEAD request at the given path.
- Parameters
path – The path to the remote resource to retrieve.
queryParams – The set of query parameters to append to the path.
headerParams – The set of headers to attach to the request.
- Returns
The value of the
Content-Length
header returned in the response.
-
virtual pplx::task<Variant> Post(const utility::string_t &path, const Variant &json, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP POST request at the given path using the provided message body.
- Parameters
path – The path to the remote resource to post.
json – The request body to send to the remote resource, encoded as a JSON object.
queryParams – The set of query parameters to append to the path.
headerParams – The set of headers to attach to the request.
- Returns
The response encoded as a JSON object.
-
virtual pplx::task<Variant> Put(const utility::string_t &path, const Variant &json, const std::map<utility::string_t, utility::string_t> &headerParams) override
Initiates an HTTP PUT request at the given path using the provided message body.
- Parameters
path – The path to the remote resource to put.
json – The request body to send to the remote resource, encoded as a JSON object.
queryParams – The set of query parameters to append to the path.
headerParams – The set of headers to attach to the request.
- Returns
The response encoded as a JSON object.
Protected Attributes
-
std::shared_ptr<Configuration> m_Configuration
-
virtual ~CprApiClient()