From e4042e8b4fe57e23ce940c0da95167f35138693a Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 18 Jun 2009 10:34:11 +0000 Subject: [PATCH] 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 --- src/SFML/Network/Http.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index af34a3456..69ee02735 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -386,6 +386,10 @@ Http::Response Http::SendRequest(const Http::Request& Req, float Timeout) Out << ToSend.myBody.size(); 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 Response Received;