34 using CurlProgressFunction = std::function<int(curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)>;
82 bool setHeaders(
const std::vector<std::string>& headers);
118 bool reset(
const std::string& url =
"");
132 struct curl_slist* m_headersList;
135 std::vector<std::string> m_headers;
136 std::string m_userAgent;
137 std::basic_ostream<char>* m_stream;
An object for making easy curl requests.
Definition curleasy.h:40
CURLcode perform()
Performs the curl request.
const std::vector< std::string > & getHeaders() const
Gets the headers to include in the request.
const std::string & getUrl() const
Gets the url to make requests to.
const std::string & getUserAgent() const
Gets the user agent to use in the request.
void setNoBody(bool noBody)
Sets whether or not to include the body in the response.
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.
CurlEasy(const std::string &url="")
Constructs a CurlEasy.
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.
bool reset(const std::string &url="")
Resets the curl request.
void setProgressFunction(const CurlProgressFunction &progress)
Sets the progress function to use during the request.
const CurlProgressFunction & getProgressFunction() const
Gets the progress function to use during the request.
bool setHeaders(const std::vector< std::string > &headers)
Sets the headers to include in the request.
~CurlEasy()
Destructs a CurlEasy.
void setStream(std::basic_ostream< char > *stream)
Sets the stream to write the response to.
std::function< int(curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)> CurlProgressFunction
Definition curleasy.h:34