Erlang: HTTP Accept Header with Inets

908 Views Asked by At

I am trying to do the equivalent of the following curl command :

curl -H "Accept: text/plain" http://127.0.0.1:8033/stats

I tried with an Inets simple http request. But, it isn't processed.

How can I specify in Inets (or some other Erlang http client for that matter) the accept header requirement?

1

There are 1 best solutions below

0
On

http:request(get, {"http://127.0.0.1:8033/stats", [{"Accept", "text/plain"}]}, [], []).