Library code style update + some minor backports from Pro edition

This commit is contained in:
Erik Zandvliet 2018-12-03 23:51:48 +01:00 committed by Thulinma
parent 593b291e85
commit 2607113727
68 changed files with 4538 additions and 4665 deletions

View file

@ -7,16 +7,20 @@ namespace HTTP{
Downloader();
std::string &data();
const std::string &const_data() const;
void doRequest(const HTTP::URL &link, const std::string &method="", const std::string &body="");
void doRequest(const HTTP::URL &link, const std::string &method = "",
const std::string &body = "");
bool get(const std::string &link);
bool get(const HTTP::URL &link, uint8_t maxRecursiveDepth = 6);
bool post(const HTTP::URL &link, const std::string &payload, bool sync = true, uint8_t maxRecursiveDepth = 6);
bool post(const HTTP::URL &link, const std::string &payload, bool sync = true,
uint8_t maxRecursiveDepth = 6);
std::string getHeader(const std::string &headerName);
std::string &getStatusText();
uint32_t getStatusCode();
bool isOk(); ///< True if the request was successful.
bool shouldContinue(); ///<True if the request should be followed-up with another. E.g. redirect or authenticate.
bool canContinue(const HTTP::URL &link);///<True if the request is able to continue, false if there is a state error or some such.
bool isOk(); ///< True if the request was successful.
bool shouldContinue(); ///< True if the request should be followed-up with another. E.g.
///< redirect or authenticate.
bool canContinue(const HTTP::URL &link); ///< True if the request is able to continue, false if
///< there is a state error or some such.
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();