开发者

Erlang: HTTP GET Parameters with Inets

开发者 https://www.devze.com 2023-01-02 21:45 出处:网络
This post indicates how to make a simple GET HTTP request with Erlang\'s Inets ap开发者_如何转开发plication.

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

精彩评论

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