简体   繁体   中英

Erlang: HTTP Accept Header with Inets

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?

http:request(get,{“ http://127.0.0.1:8033/stats ”,[{“ Accept”,“ text / plain”}]},[],[])。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM