specify Content-Type: application/json HTTP header (#129)

This commit is contained in:
tersec 2022-02-23 07:43:08 +00:00 committed by GitHub
parent 733a05b00c
commit 0540afad4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,8 @@ method call*(client: RpcHttpClient, name: string,
reqBody = $rpcCallNode(name, params, id)
req = HttpClientRequestRef.post(client.httpSession,
client.httpAddress.get,
body = reqBody.toOpenArrayByte(0, reqBody.len - 1))
body = reqBody.toOpenArrayByte(0, reqBody.len - 1),
headers = [("Content-Type", "application/json")])
res =
try:
await req.send()