bool HTTPClient::POST(const std::string url, const std::string postdata, std::string &response) { std::vector<unsigned char> vHTTPResponse; if (!POSTBinary(url,postdata,vHTTPResponse)) return false; response.insert( response.begin(), vHTTPResponse.begin(), vHTTPResponse.end() ); return true; }
bool HTTPClient::POST(const std::string &url, const std::string &postdata, const std::vector<std::string> &ExtraHeaders, std::string &response, const bool bFollowRedirect) { response = ""; std::vector<unsigned char> vHTTPResponse; if (!POSTBinary(url,postdata,ExtraHeaders, vHTTPResponse, bFollowRedirect)) return false; if (vHTTPResponse.empty()) return true; //empty response possible response.insert(response.begin(), vHTTPResponse.begin(), vHTTPResponse.end()); return true; }