开发者

Erlang HTTP: How do you include Body in an Inets or Ibrowse request?

开发者 https://www.devze.com 2023-01-04 23:48 出处:网络
I am current开发者_开发技巧ly using Inets with the following request: http:request(put, {Url, [{\"User-Agent\", UA}, {\"Content-type\",

I am current开发者_开发技巧ly using Inets with the following request:

http:request(put, {Url, [{"User-Agent", UA}, {"Content-type", 
             "application/json"}]}, Bodytext, []),

But the request fails.

Any suggestions?


ibrowse:start().

ibrowse:send_req(Url, Headers, put, Body).

OR

ibrowse:send_req(Url, Headers, put, Body, Options).


Try this: http:request(put, {Url, [{"User-Agent", UA}], "application/json", Bodytext}, [], [])

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号