开发者

Erlang: HTTP GET Parameters with Inets

This post indicates how to make a simple GET HTTP request with Erlang's Inets ap开发者_如何转开发plication.

Sometimes, URLs have GET parameters:

http://example.net/item?parameter1=12&parameter2=1431&parameter3=8765

Besides including the parameters in the URL itself, is there a way to create variables and then send them with the request?

Example appreciated.


ssl:start(),
application:start(inets),
httpc:request(post,
   {"https://postman-echo.com/post",
     [],"text/plain","parameter1=12&parameter2=1431&parameter3=8765"},
   [], []).

You can use this example to use string interpolation to make a variable for parameter1..parameter3=8765.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜