An object for making easy curl requests.
More...
#include <curleasy.h>
|
| CurlEasy (const std::string &url="") |
| Constructs a CurlEasy.
|
|
| ~CurlEasy () |
| Destructs a CurlEasy.
|
|
const std::string & | getUrl () const |
| Gets the url to make requests to.
|
|
void | setUrl (const std::string &url) |
| Sets the url to make requests to.
|
|
bool | getNoBody () const |
| Gets whether or not to include the body in the response.
|
|
void | setNoBody (bool noBody) |
| Sets whether or not to include the body in the response.
|
|
const std::vector< std::string > & | getHeaders () const |
| Gets the headers to include in the request.
|
|
bool | setHeaders (const std::vector< std::string > &headers) |
| Sets the headers to include in the request.
|
|
const std::string & | getUserAgent () const |
| Gets the user agent to use in the request.
|
|
void | setUserAgent (const std::string &userAgent) |
| Sets the user agent to use in the request.
|
|
std::basic_ostream< char > * | getStream () const |
| Gets the stream to write the response to.
|
|
void | setStream (std::basic_ostream< char > *stream) |
| Sets the stream to write the response to.
|
|
const CurlProgressFunction & | getProgressFunction () const |
| Gets the progress function to use during the request.
|
|
void | setProgressFunction (const CurlProgressFunction &progress) |
| Sets the progress function to use during the request.
|
|
bool | reset (const std::string &url="") |
| Resets the curl request.
|
|
CURLcode | perform () |
| Performs the curl request.
|
|
An object for making easy curl requests.
◆ CurlEasy()
Nickvision::Network::CurlEasy::CurlEasy |
( |
const std::string & | url = "" | ) |
|
Constructs a CurlEasy.
- Parameters
-
url | The url to make requests to |
- Exceptions
-
std::runtime_error | If curl fails to initialize |
◆ ~CurlEasy()
Nickvision::Network::CurlEasy::~CurlEasy |
( |
| ) |
|
◆ getHeaders()
const std::vector< std::string > & Nickvision::Network::CurlEasy::getHeaders |
( |
| ) |
const |
Gets the headers to include in the request.
- Returns
- The headers to include
◆ getNoBody()
bool Nickvision::Network::CurlEasy::getNoBody |
( |
| ) |
const |
Gets whether or not to include the body in the response.
- Returns
- True to exclude the body, else false
◆ getProgressFunction()
Gets the progress function to use during the request.
- Returns
- The progress function to use
◆ getStream()
std::basic_ostream< char > * Nickvision::Network::CurlEasy::getStream |
( |
| ) |
const |
Gets the stream to write the response to.
- Returns
- The stream to write the response to
◆ getUrl()
const std::string & Nickvision::Network::CurlEasy::getUrl |
( |
| ) |
const |
Gets the url to make requests to.
- Returns
- The url to make requests to
◆ getUserAgent()
const std::string & Nickvision::Network::CurlEasy::getUserAgent |
( |
| ) |
const |
Gets the user agent to use in the request.
- Returns
- The user agent to use
◆ perform()
CURLcode Nickvision::Network::CurlEasy::perform |
( |
| ) |
|
Performs the curl request.
- Returns
- The code returned by the curl request
◆ reset()
bool Nickvision::Network::CurlEasy::reset |
( |
const std::string & | url = "" | ) |
|
Resets the curl request.
- Parameters
-
url | The url to make requests to |
- Returns
- True if successful, else false
◆ setHeaders()
bool Nickvision::Network::CurlEasy::setHeaders |
( |
const std::vector< std::string > & | headers | ) |
|
Sets the headers to include in the request.
- Parameters
-
headers | The headers to include |
- Returns
- True if successful, else false
◆ setNoBody()
void Nickvision::Network::CurlEasy::setNoBody |
( |
bool | noBody | ) |
|
Sets whether or not to include the body in the response.
- Parameters
-
noBody | True to exclude the body, else false |
◆ setProgressFunction()
Sets the progress function to use during the request.
- Parameters
-
progress | The progress function to use |
◆ setStream()
void Nickvision::Network::CurlEasy::setStream |
( |
std::basic_ostream< char > * | stream | ) |
|
Sets the stream to write the response to.
- Parameters
-
stream | The stream to write the response to |
◆ setUrl()
void Nickvision::Network::CurlEasy::setUrl |
( |
const std::string & | url | ) |
|
Sets the url to make requests to.
- Parameters
-
url | The url to make requests to |
◆ setUserAgent()
void Nickvision::Network::CurlEasy::setUserAgent |
( |
const std::string & | userAgent | ) |
|
Sets the user agent to use in the request.
- Parameters
-
userAgent | The user agent to use |
The documentation for this class was generated from the following file: