Cannot connect localhost with phpStorm REST client

Hi community,

I'm developing a REST API in PHP 7.0 with phpStorm. I'm using "PHP Built-in Web Server" as a server (screenshot of the configuration below)

Now I'm trying the integrated REST Client and I'm getting this error:

POST http://localhost:8080/api/authentication

org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

 

But every other test works (browser, telnet, other REST clients...). Integrated REST client works with other services (like http://now.httpbin.org/ )

What am I doing wrong?

(Using phpStorm 2017.3.1 on macOS 10.13.3)

 

2 comments

You're doing everything right, it's a bug. Please try the workaround suggested here: https://youtrack.jetbrains.com/issue/WI-34339#comment=27-2714660

Also, for me, the issue is not reproducible in 2018.1 EAP, so you might wanna give it a try as well: https://www.jetbrains.com/phpstorm/eap/

2

Solution given (using 127.0.0.1 instead of localhost) works. Thank you!

0

Please sign in to leave a comment.