5 #include <unordered_map>
17 using std::unique_ptr;
18 using std::unordered_map;
58 static string urlEncode(
const string& value);
144 this->getParameters = parameters;
void cancel()
Cancel a started download.
unordered_map< string, string > headers
const string & getFile()
Get file to download to.
const string & getUsername()
Get username.
uint64_t parseHTTPResponseHeaders(ifstream &rawResponse)
Parse HTTP response headers.
void setPassword(const string &password)
Set password.
const unordered_map< string, string > & getResponseHeaders()
unique_ptr< Thread > downloadThread
void start()
Starts the HTTP download to file.
const unordered_map< string, string > & getHeaders()
Get request headers.
unordered_map< string, string > getParameters
void join()
Wait until underlying thread has finished.
Mutex downloadThreadMutex
const unordered_map< string, string > & getGETParameters()
Get GET parameter.
void setGETParameters(const unordered_map< string, string > ¶meters)
Set GET parameter.
void setUsername(const string &username)
Set username.
unordered_map< string, string > responseHeaders
static string urlEncode(const string &value)
Returns a URL encoded representation of value.
void setHeaders(const unordered_map< string, string > &headers)
Set request headers.
void reset()
Reset this HTTP client.
const string & getURL()
Get URL.
const string & getPassword()
Get password.
static constexpr const int16_t HTTP_STATUSCODE_OK
void setFile(const string &file)
Set file to download to.
void setURL(const string &url)
Set URL.
HTTPDownloadClient()
Public constructor.
string createHTTPRequestHeaders(const string &hostName, const string &relativeUrl)
Create HTTP request headers.
Base exception class for network exceptions.