rename Http:put() to Http:post() and add a separate Http:put()

This commit is contained in:
2022-11-17 02:47:00 +01:00
parent 1d0956abab
commit 204688464e
2 changed files with 47 additions and 5 deletions

View File

@@ -165,6 +165,10 @@ public:
bool get(const std::wstring & url, pt::WTextStream & out, bool clear_stream = true);
bool get(const pt::WTextStream & url, pt::WTextStream & out, bool clear_stream = true);
bool post(const wchar_t * url, const std::string & in, pt::WTextStream & out, bool clear_stream = true);
bool post(const std::wstring & url, const std::string & in, pt::WTextStream & out, bool clear_stream = true);
bool post(const wchar_t * url, pt::WTextStream & in, pt::WTextStream & out, bool clear_stream = true);
bool put(const wchar_t * url, const std::string & in, pt::WTextStream & out, bool clear_stream = true);
bool put(const std::wstring & url, const std::string & in, pt::WTextStream & out, bool clear_stream = true);
bool put(const wchar_t * url, pt::WTextStream & in, pt::WTextStream & out, bool clear_stream = true);
@@ -196,6 +200,7 @@ private:
pt::Space * debug_info;
bool follow_location;
bool verify_ssl_cert;
bool use_post_method; /* if false then use put method - used only when calling post() or put() methods */
std::wstring temp_header;
std::string temp_header_ascii;
@@ -203,6 +208,7 @@ private:
std::wstring temp_header_value;
std::string temp_header_value_ascii;
bool post_put(const wchar_t * url, const std::string & in, pt::WTextStream & out, bool clear_stream);
bool fetch_internal(const char * url, const std::string * in, pt::TextStream & out);
static size_t fetch_read_function(char * ptr, size_t size, size_t nmemb, void * userdata);
static int fetch_seek_set(Http * http, curl_off_t offset);