Improvements to Downloader class to allow for more flexibility in usage

This commit is contained in:
Thulinma 2017-07-25 11:50:04 +02:00
parent 96c451463b
commit 871bee3436
2 changed files with 45 additions and 28 deletions

View file

@ -6,6 +6,7 @@ namespace HTTP{
public:
Downloader(){progressCallback = 0;}
std::string &data();
void doRequest(const HTTP::URL &link);
bool get(const std::string &link);
bool get(const HTTP::URL &link, uint8_t maxRecursiveDepth = 6);
std::string getHeader(const std::string &headerName);
@ -15,6 +16,8 @@ namespace HTTP{
bool (*progressCallback)(); ///< Called every time the socket stalls, up to 4X per second.
void setHeader(const std::string &name, const std::string &val);
void clearHeaders();
Parser &getHTTP();
Socket::Connection &getSocket();
private:
std::map<std::string, std::string> extraHeaders; ///< Holds extra headers to sent with request