5

I have a RESTful web service taking all 4 HTTP request methods. I am getting proper responses when I am using a rest client (Advanced Rest Client in Chrome) to send requests to this service using the ip address of the machine. My url is this http://ipaddress:8080/messenger/webapi/messages. However, when I use curl to fire the same requests I get curl: (56) Recv failure: Connection was reset. The only difference I found out in the two was that the REST client fires requests from 0.0.0.0 and the curl requests are fired from 127.0.0.1. But why should this make any difference?

The same curl command works when the app is running on the same machine from which the curl is fired. It doesn't work only when the app is running on another machine. Eg. curl http://ipaddress:8080/messenger/webapi/messages for GET request.

I tried disabling the firewall on the machine having the app with no luck.

5
  • you should look at and compare the HTTP messages on the wire
    – Hans Z.
    Apr 20, 2016 at 6:58
  • Hans Z my request seems to be correct since its working if the app is on the same machine. Apr 20, 2016 at 11:28
  • 1
    there's some other firewall in between that drops the connection then
    – Hans Z.
    Apr 20, 2016 at 11:53
  • Hans Z I am able to telnet to the port 8080 of the other machine. Apr 25, 2016 at 11:54
  • In case someone ends up here searching for the error message, I got the same error when my server was using port 80 but i accidentally configured it to use ssl. curl http://server was failing with curl: (56) Recv failure: Connection was reset.
    – psmith
    Feb 7, 2017 at 5:07

2 Answers 2

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

9

Check which port curl uses and whether it is blocked by the firewall or not. Also check whether the port on the app accepts requests.

0

I'm writing simple php-socket server and got same errors when closing «non-blocked» socket immediately after write, without flushing.

Also check (if possible), that RESTful web service Server flushes write buffer BEFORE closing connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.