Greetings,
I'm trying to consume an JSON API, but I need to pass some Headers along my GET
call.
My code is the following:
import httpclient, json
let client = newHttpClient()
client.headers = newHttpHeaders({ "Content-Type": "application/json" })
let body = %
Here is a working example:
import httpclient, json
let client = newHttpClient()
client.headers = newHttpHeaders({ "Content-Type": "application/json",
"x-mashape-proxy-secret": "asdfgqwert",
"x-mas
You're mixing old and new API here. request proc from old API (the one that
doesn't use HttpClient) does indeed have extraHeaders parameter. It is,
however, deprecated. The new API tends to pass headers in a client. There is,
however, an option to pass per-request headers to new request proc in
@pdv, thank you for your support. Can you pls kindly help me to fix my code ? I
tried to rewrite it following the description of the provided branch, but I got
no success. I think I'm missing some key concept. All the best, AN