mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
Fix async httpclient post to work without multipart
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user