40 #ifndef __OPENFLUID_UTILS_HTTPCLIENT_HPP__
41 #define __OPENFLUID_UTILS_HTTPCLIENT_HPP__
61 std::list<std::pair<std::string,std::string>>
Data;
63 bool exists(
const std::string& Key)
const;
65 void add(
const std::string& Key,
const std::string& Value);
109 unsigned int NetworkError = 0;
114 bool OtherError =
false;
135 std::string m_BaseURL;
139 int m_AllowedRedirections = -1;
141 bool m_VerifyCertificates =
true;
145 const std::string& ContentOutputPath = std::string())
const;
182 return m_DefaultHeaders;
196 setAllowedRedirections(-1);
Definition: HTTPClient.hpp:56
Response deleteResource(const Request &Req) const
Response getResource(const Request &Req) const
CPPCLASS_DEFAULT_FIVE(HTTPClient)
std::string getBaseURL() const
Definition: HTTPClient.hpp:162
void setCertificateVerify(bool Verify)
void disallowRedirections()
Definition: HTTPClient.hpp:194
void setBaseURL(const std::string &BaseURL)
Definition: HTTPClient.hpp:171
Response postResource(const Request &Req) const
HTTPClient(const std::string &BaseURL)
static bool downloadToString(const std::string &URL, std::string &Content)
KeyValueList & defaultHeaders()
Definition: HTTPClient.hpp:180
static bool downloadToFile(const std::string &URL, const std::string &FilePath)
Response patchResource(const Request &Req) const
Response putResource(const Request &Req) const
void setAllowedRedirections(int MaxRedir)
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: ApplicationException.hpp:47
Definition: HTTPClient.hpp:60
void add(const std::string &Key, const std::string &Value)
void remove(const std::string &Key)
std::list< std::pair< std::string, std::string > > Data
Definition: HTTPClient.hpp:61
bool exists(const std::string &Key) const
Definition: HTTPClient.hpp:74
std::string Path
Path of the request, relative to the base URL of the client.
Definition: HTTPClient.hpp:78
std::string Body
Request body.
Definition: HTTPClient.hpp:93
KeyValueList Parameters
Parameters list to pass in URL.
Definition: HTTPClient.hpp:83
KeyValueList Headers
Request headers.
Definition: HTTPClient.hpp:88
Definition: HTTPClient.hpp:100
std::string ErrorStr
Error string if an error occurred.
Definition: HTTPClient.hpp:119
std::string Content
Response content.
Definition: HTTPClient.hpp:124