Erlang: HTTP GET Parameters with Inets
Asked Answered
S

1

6

This post indicates how to make a simple GET HTTP request with Erlang's Inets application.

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.

Susannsusanna answered 8/6, 2010 at 11:15 Comment(0)
C
0
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.

Cloutman answered 23/11, 2020 at 20:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.