Httpclient Extra Headers Error

2016-11-14 Thread alfrednewman
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 = %

Re: Httpclient Extra Headers Error

2016-11-15 Thread dom96
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

Re: Httpclient Extra Headers Error

2016-11-15 Thread pdv
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

Re: Httpclient Extra Headers Error

2016-11-15 Thread alfrednewman
@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