Merge pull request #3095 from def-/fix-async-post
Fix async httpclient post to work without multipart
This commit is contained in:
commit
994d81461b
1 changed files with 3 additions and 2 deletions
|
|
@ -834,7 +834,8 @@ 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue