Appwrite C++ SDK
Auto-generated API documentation for the Appwrite C++ SDK
Loading...
Searching...
No Matches
Utils Class Reference

Provides static utility functions for HTTP requests and data formatting. More...

#include <Utils.hpp>

Collaboration diagram for Utils:

Static Public Member Functions

static std::string boolToString (bool value)
 Convert a boolean to a string ("true"/"false").
 
static int deleteRequest (const std::string &url, const std::vector< std::string > &headers, std::string &response)
 Make an HTTP DELETE request.
 
static std::string escapeJsonString (const std::string &input)
 Escape special characters in a JSON string.
 
static int getRequest (const std::string &url, const std::vector< std::string > &headers, std::string &response)
 Make an HTTP GET request.
 
static int patchRequest (const std::string &url, const std::string &payload, const std::vector< std::string > &headers, std::string &response)
 Make an HTTP PATCH request.
 
static int postRequest (const std::string &url, const std::string &payload, const std::vector< std::string > &headers, std::string &response)
 Make an HTTP POST request.
 
static int putRequest (const std::string &url, const std::string &payload, const std::vector< std::string > &headers, std::string &response)
 Make an HTTP PUT request.
 
static std::string urlEncode (const std::string &value)
 URL-encode a string.
 

Detailed Description

Provides static utility functions for HTTP requests and data formatting.

Definition at line 15 of file Utils.hpp.

Member Function Documentation

◆ boolToString()

static std::string Utils::boolToString ( bool  value)
static

Convert a boolean to a string ("true"/"false").

Parameters
valueBoolean value.
Returns
std::string "true" or "false".

◆ deleteRequest()

static int Utils::deleteRequest ( const std::string &  url,
const std::vector< std::string > &  headers,
std::string &  response 
)
static

Make an HTTP DELETE request.

Parameters
urlEndpoint URL.
headersList of HTTP headers.
responseOutput string to store server response.
Returns
int HTTP response code.

◆ escapeJsonString()

static std::string Utils::escapeJsonString ( const std::string &  input)
static

Escape special characters in a JSON string.

Parameters
inputInput string.
Returns
std::string Escaped JSON string.

◆ getRequest()

static int Utils::getRequest ( const std::string &  url,
const std::vector< std::string > &  headers,
std::string &  response 
)
static

Make an HTTP GET request.

Parameters
urlEndpoint URL.
headersList of HTTP headers.
responseOutput string to store server response.
Returns
int HTTP response code.

◆ patchRequest()

static int Utils::patchRequest ( const std::string &  url,
const std::string &  payload,
const std::vector< std::string > &  headers,
std::string &  response 
)
static

Make an HTTP PATCH request.

Parameters
urlEndpoint URL.
payloadJSON payload to send.
headersList of HTTP headers.
responseOutput string to store server response.
Returns
int HTTP response code.

◆ postRequest()

static int Utils::postRequest ( const std::string &  url,
const std::string &  payload,
const std::vector< std::string > &  headers,
std::string &  response 
)
static

Make an HTTP POST request.

Parameters
urlEndpoint URL.
payloadJSON payload to send.
headersList of HTTP headers.
responseOutput string to store server response.
Returns
int HTTP response code.

◆ putRequest()

static int Utils::putRequest ( const std::string &  url,
const std::string &  payload,
const std::vector< std::string > &  headers,
std::string &  response 
)
static

Make an HTTP PUT request.

Parameters
urlEndpoint URL.
payloadJSON payload to send.
headersList of HTTP headers.
responseOutput string to store server response.
Returns
int HTTP response code.

◆ urlEncode()

static std::string Utils::urlEncode ( const std::string &  value)
static

URL-encode a string.

Parameters
valueInput string.
Returns
std::string URL-encoded string.

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