From 0540afad4cd4514cd3f20469842b697bc1723418 Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 23 Feb 2022 07:43:08 +0000 Subject: [PATCH] specify Content-Type: application/json HTTP header (#129) --- json_rpc/clients/httpclient.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/json_rpc/clients/httpclient.nim b/json_rpc/clients/httpclient.nim index 9986523..58adae9 100644 --- a/json_rpc/clients/httpclient.nim +++ b/json_rpc/clients/httpclient.nim @@ -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()