Reputation: 237
I am using the code below for sending an HTTP POST request, and it's not giving any error but I am not able to hit the server using this. Can anyone help me determine what could be the issue with this, or if I am missing something.
start() ->
inets:start(),
io:fwrite("inet started \n"),
httpc:request(post, {"[http://api.myapp.com/apipush.php]", [],
"application/x-www-form-urlencoded", ""},[],[]),
io:fwrite("req sent!\n").
Upvotes: 0
Views: 774
Reputation: 20014
I think you have some misplaced square brackets in your call to the server. Remove the [
and ]
from around the URL, like this:
httpc:request(post, {"http://api.myapp.com/apipush.php", [],
"application/x-www-form-urlencoded", ""},[],[]),
Upvotes: 3