summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-01-13 19:31:25 +0000
committerDominik Picheta <dominikpicheta@googlemail.com>2015-01-13 19:31:25 +0000
commitc94f5bfb0612b1ed63ceddd156dbee968b6bf896 (patch)
tree1f79bab5c065616f651827a73bad301ffbe6768b
parent4754d2dcbde4be1e9d0de8f9b3c3502e66c4ca24 (diff)
parentf2c1b3be1341e85b17dc4dc5958a42f330285237 (diff)
downloadNim-c94f5bfb0612b1ed63ceddd156dbee968b6bf896.tar.gz
Merge pull request #1948 from def-/httpclient-again
Fix body in httpclient
-rw-r--r--lib/pure/httpclient.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim
index bfdfed72c..d9f161d49 100644
--- a/lib/pure/httpclient.nim
+++ b/lib/pure/httpclient.nim
@@ -505,7 +505,7 @@ proc post*(url: string, extraHeaders = "", body = "",
     else:
       x
 
-  var xb = mpBody.withNewLine() & body.withNewLine()
+  var xb = mpBody.withNewLine() & body
 
   var xh = extraHeaders.withNewLine() & mpHeaders.withNewLine() &
     withNewLine("Content-Length: " & $len(xb))
@@ -517,7 +517,7 @@ proc post*(url: string, extraHeaders = "", body = "",
     if result.status.redirection():
       let redirectTo = getNewLocation(lastURL, result.headers)
       var meth = if result.status != "307": httpGet else: httpPost
-      result = request(redirectTo, meth, xh, body, sslContext, timeout,
+      result = request(redirectTo, meth, xh, xb, sslContext, timeout,
                        userAgent, proxy)
       lastUrl = redirectTo