bool complete;
bool failed;
string bodyData;
+ string bodyContentType;
TestRequest(const std::string& url, const std::string method = "GET") :
HTTP::Request(url, method),
complete(false)
{
+ bodyContentType = "text/plain";
}
std::map<string, string> sendHeaders;
bodyData += string(s, n);
}
+ virtual std::string requestBodyType() const
+ {
+ return bodyContentType;
+ }
+
virtual void responseHeader(const string& header, const string& value)
{
headers[header] = value;
{
cout << "POST" << endl;
TestRequest* tr = new TestRequest("http://localhost:2000/test_post?foo=abc&bar=1234&username=johndoe", "POST");
+ tr->bodyContentType = "application/x-www-form-urlencoded";
+
HTTP::Request_ptr own(tr);
cl.makeRequest(tr);
waitForComplete(&cl, tr);