Before sending a request, you need to run ssl and inets. Depending on the type of data you are trying to publish, you need to format it differently. My example shows data with urlencoded
ssl:start(), application:start(inets), httpc:request(post, {"https://postman-echo.com/post", [], "application/x-www-form-urlencoded", "example=here&foo=bar" }, [], []).
JSON request will look like
ssl:start(), application:start(inets), httpc:request(post, {"https://postman-echo.com/post", [], "application/json", "{'example':'here', 'foo':'bar'}" }, [], []).
Zachary orr
source share