FS#117 - Fix POST requests not working with sf::Http

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1147 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-06-18 10:34:11 +00:00
parent 0ad6295ff4
commit e4042e8b4f

View File

@ -386,6 +386,10 @@ Http::Response Http::SendRequest(const Http::Request& Req, float Timeout)
Out << ToSend.myBody.size(); Out << ToSend.myBody.size();
ToSend.SetField("Content-Length", Out.str()); ToSend.SetField("Content-Length", Out.str());
} }
if ((ToSend.myMethod == Request::Post) && !ToSend.HasField("Content-Type"))
{
ToSend.SetField("Content-Type", "application/x-www-form-urlencoded");
}
// Prepare the response // Prepare the response
Response Received; Response Received;