diff options
author | def <dennis@felsin9.de> | 2015-07-10 00:32:39 +0200 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-07-10 00:32:39 +0200 |
commit | e264fa24cd6e0a2ac4c960518fa73e12a2006bd0 (patch) | |
tree | 50e8e21cbde54a4e999c4bd400df15a1b4a59643 /lib/pure | |
parent | 7d1a58224ef250dd38a84bda94026120e60767eb (diff) | |
download | Nim-e264fa24cd6e0a2ac4c960518fa73e12a2006bd0.tar.gz |
Fix async httpclient post to work without multipart
Diffstat (limited to 'lib/pure')
-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 |