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.

toraritte
  • 6,300
  • 3
  • 46
  • 67
Ted Karmel
  • 1,046
  • 1
  • 12
  • 20

1 Answers1

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.

2240
  • 1,547
  • 2
  • 12
  • 30