#include <utils/HTTPClient.hpp>
|
static bool | downloadToString (const std::string &URL, std::string &Content) |
|
static bool | downloadToFile (const std::string &URL, const std::string &FilePath) |
|
◆ HTTPClient()
openfluid::utils::HTTPClient::HTTPClient |
( |
const std::string & |
BaseURL | ) |
|
Constructs an HTTP client with the given base URL
- Parameters
-
[in] | BaseURL | the base URL used by the client that will prefix requests paths |
◆ CPPCLASS_DEFAULT_FIVE()
openfluid::utils::HTTPClient::CPPCLASS_DEFAULT_FIVE |
( |
HTTPClient |
| ) |
|
◆ defaultHeaders()
KeyValueList& openfluid::utils::HTTPClient::defaultHeaders |
( |
| ) |
|
|
inline |
The default headers added to the headers of any request
- Returns
- a reference to the default headers
◆ deleteResource()
Response openfluid::utils::HTTPClient::deleteResource |
( |
const Request & |
Req | ) |
const |
Performs a DELETE request
- Parameters
-
- Returns
- the response to the request
- Warning
- not implemented
◆ disallowRedirections()
void openfluid::utils::HTTPClient::disallowRedirections |
( |
| ) |
|
|
inline |
Disallows redirections (sets allowed redirections to -1)
◆ downloadToFile()
static bool openfluid::utils::HTTPClient::downloadToFile |
( |
const std::string & |
URL, |
|
|
const std::string & |
FilePath |
|
) |
| |
|
static |
Downloads URL contents to file
- Parameters
-
[in] | URL | The URL for the download |
[out] | FilePath | The path of the file to store the downloaded contents |
◆ downloadToString()
static bool openfluid::utils::HTTPClient::downloadToString |
( |
const std::string & |
URL, |
|
|
std::string & |
Content |
|
) |
| |
|
static |
Downloads URL contents to string
- Parameters
-
[in] | URL | The URL for the download |
[out] | Content | The string containing the downloaded contents |
◆ getBaseURL()
std::string openfluid::utils::HTTPClient::getBaseURL |
( |
| ) |
const |
|
inline |
Returns the base URL of the client
- Returns
- the base URL used by the client that will prefix requests paths
◆ getResource()
Response openfluid::utils::HTTPClient::getResource |
( |
const Request & |
Req | ) |
const |
Performs a GET request
- Parameters
-
- Returns
- the response to the request
◆ patchResource()
Response openfluid::utils::HTTPClient::patchResource |
( |
const Request & |
Req | ) |
const |
Performs a PATCH request
- Parameters
-
- Returns
- the response to the request
- Warning
- not implemented
◆ postResource()
Response openfluid::utils::HTTPClient::postResource |
( |
const Request & |
Req | ) |
const |
Performs a POST request
- Parameters
-
- Returns
- the response to the request
◆ putResource()
Response openfluid::utils::HTTPClient::putResource |
( |
const Request & |
Req | ) |
const |
Performs a PUT request
- Parameters
-
- Returns
- the response to the request
- Warning
- not implemented
◆ setAllowedRedirections()
void openfluid::utils::HTTPClient::setAllowedRedirections |
( |
int |
MaxRedir | ) |
|
Sets maximum allowed redirections
- Parameters
-
[in] | MaxRedir | maximum allowed redirections |
◆ setBaseURL()
void openfluid::utils::HTTPClient::setBaseURL |
( |
const std::string & |
BaseURL | ) |
|
|
inline |
Sets the base URL of the client
- Parameters
-
[in] | BaseURL | the base URL used by the client that will prefix requests paths |
◆ setCertificateVerify()
void openfluid::utils::HTTPClient::setCertificateVerify |
( |
bool |
Verify | ) |
|
Enables or disables SSL certicates verification
- Parameters
-
[in] | Verify | enable or disable verification |
The documentation for this class was generated from the following file: