diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-07-11 14:06:30 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-07-11 14:06:30 +0100 |
commit | 994d81461bbac0a7931436e03f8d419ef22014cb (patch) | |
tree | 32e926d681138376da7fb8abf527c5d034f82c26 | |
parent | 6049c0143204927fd7701d1c052e034bedb676c3 (diff) | |
parent | e264fa24cd6e0a2ac4c960518fa73e12a2006bd0 (diff) | |
download | Nim-994d81461bbac0a7931436e03f8d419ef22014cb.tar.gz |
Merge pull request #3095 from def-/fix-async-post
Fix async httpclient post to work without multipart
-rw-r--r-- | lib/pure/httpclient.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 2ca2098b3..e6b8088c5 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -834,11 +834,12 @@ proc post*(client: AsyncHttpClient, url: string, body = "", multipart: Multipart else: x var xb = mpBody.withNewLine() & body - client.headers["Content-Type"] = mpHeader.split(": ")[1] + if multipart != nil: + client.headers["Content-Type"] = mpHeader.split(": ")[1] client.headers["Content-Length"] = $len(xb) result = await client.request(url, httpPOST, xb) - + when not defined(testing) and isMainModule: when true: # Async |