add Http::allow_redirects(bool allow_redirects) method

This commit is contained in:
2022-08-13 20:00:15 +02:00
parent ca1a854fd1
commit e88615226b
2 changed files with 17 additions and 1 deletions

View File

@@ -51,6 +51,8 @@ class Http : public WinixBase
public:
static const long HTTP_STATUS_200_OK = 200;
static const long HTTP_STATUS_301_Moved_Permanently = 301;
static const long HTTP_STATUS_302_Found = 302;
Http();
@@ -143,6 +145,12 @@ public:
Http & add_bearer_token(const wchar_t * token);
Http & add_bearer_token(const std::wstring & token);
/*
* if allow_redirects is true then we follow any Location http headers
* default: true
*/
void allow_redirects(bool allow_redirects);
bool get(const wchar_t * url, std::wstring & out, bool clear_str = true);
bool get(const std::wstring & url, std::wstring & out, bool clear_str = true);
bool get(const pt::WTextStream & url, std::wstring & out, bool clear_str = true);
@@ -180,6 +188,7 @@ private:
std::wstring * output_content_type;
long debug_mode;
pt::Space * debug_info;
bool follow_location;
std::wstring temp_header;
std::string temp_header_ascii;