Connection object for advanced usage.
More...
#include <connection.h>
Classes
holds some diagnostics information about the connection object it came from
More...
holds some diagnostics information about a request
More...
Public Member Functions
void
SetBasicAuth (const std::string &username, const std::string &password)
set username and password for basic auth
More...
configure whether to follow redirects on this connection
More...
set custom user agent for connection. This gets prepended to the default restclient-cpp/RESTCLIENT_VERSION string
More...
set custom Certificate Authority (CA) path
More...
void SetCertPath (const std::string &cert)
void SetCertType (const std::string &type)
void SetKeyPath (const std::string &keyPath)
get the user agent to add to the request
More...
get diagnostic information about the connection object
More...
set the custom headers map. This will replace the currently configured headers with the provided ones. If you want to add additional headers, use
AppendHeader() More...
get all custom headers set on the connection
More...
void
AppendHeader (const std::string &key, const std::string &value)
append a header to the internal map
More...
Detailed Description
Constructor & Destructor Documentation
RestClient::Connection::Connection
(
const std::string &
baseUrl )
explicit
constructor for the Connection object
- Parameters
-
baseUrl - base URL for the connection to use
Member Function Documentation
void RestClient::Connection::AppendHeader
(
const std::string &
key,
const std::string &
value
)
append a header to the internal map
- Parameters
-
key for the header field
value for the header field
HTTP DELETE method.
- Parameters
-
url to query
- Returns
- response struct
we want HTTP DELETE
set HTTP DELETE METHOD
void RestClient::Connection::FollowRedirects
(
bool
follow )
configure whether to follow redirects on this connection
- Parameters
-
follow - boolean whether to follow redirects
HTTP GET method.
- Parameters
-
url to query
- Returns
- response struct
std::string RestClient::Connection::GetUserAgent
(
)
get the user agent to add to the request
- Returns
- user agent as std::string
HTTP HEAD method.
- Parameters
-
url to query
- Returns
- response struct
we want HTTP HEAD
set HTTP HEAD METHOD
const std::string &
data
)
HTTP POST method.
- Parameters
-
url to query
data HTTP POST body
- Returns
- response struct
Now specify we want to POST data
set post fields
const std::string &
data
)
HTTP PUT method.
- Parameters
-
url to query
data HTTP PUT body
- Returns
- response struct
initialize upload object
Now specify we want to PUT data
set read callback function
set data object to pass to callback function
set data size
void RestClient::Connection::SetBasicAuth
(
const std::string &
username,
const std::string &
password
)
set username and password for basic auth
- Parameters
-
username
password
void RestClient::Connection::SetCAInfoFilePath
(
const std::string &
caInfoFilePath )
set custom Certificate Authority (CA) path
- Parameters
-
caInfoFilePath - The path to a file holding the certificates used to verify the peer with. See CURLOPT_CAINFO
set the custom headers map. This will replace the currently configured headers with the provided ones. If you want to add additional headers, use AppendHeader()
- Parameters
-
headers to set
void RestClient::Connection::SetTimeout
(
int
seconds )
set timeout for connection
- Parameters
-
seconds - timeout in seconds
void RestClient::Connection::SetUserAgent
(
const std::string &
userAgent )
set custom user agent for connection. This gets prepended to the default restclient-cpp/RESTCLIENT_VERSION string
- Parameters
-
userAgent - custom userAgent prefix
The documentation for this class was generated from the following files: