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¶meter2=1431¶meter3=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¶meter2=1431¶meter3=8765"},
[], []).
You can use this example to use string interpolation to make a variable for parameter1..parameter3=8765
.
精彩评论