Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman can't reach localhost

Tags:

proxy

postman

I am in a corporate env so I have to use a proxy to reach servers. This works well in postman and in browsers. What I can't reach is localhost in postman but I can reach localhost in the browser.

I am running Postman for Linux Version 6.0.9. I have tried reaching localhost:9082/rest/myapi.... and 127.0.0.1:9082/rest/myapi with both global proxy and system proxy turned on and with either turned on and with non turned on. In all cases I am not able to reach localhost.

What I get as an response is an error page from the proxy server! Someway the call gets out on the network instead of being kept on my machine.

The postman console:

My request headers are:

Cache-Control →no-cache Connection →Keep-Alive Content-Length →986 Content-Type →text/html; charset=utf-8 Pragma →no-cache Proxy-Connection →Keep-Alive 

My response headers are:

cache-control:"no-cache" pragma:"no-cache" content-type:"text/html; charset=utf-8" proxy-connection:"Keep-Alive" connection:"Keep-Alive" content-length:"986" 

My response body is an html page.

How can I make a call to localhost work with postman?

like image 585
user1329339 Avatar asked Mar 06 '18 12:03

user1329339


People also ask

How do I access my localhost Postman?

Making GET Requests with Postman To see all of the users that are currently in the database, make a GET request to localhost:4000/users . To do this, you should: Make sure the dropdown is set to GET. Enter the URL localhost:4000/users in the textbox that says “Enter request URL”.

Why Postman is showing could not send request?

If Postman fails to send your request, you may be experiencing connectivity issues. Check your connection by attempting to open a page in your web browser. Some firewalls may be configured to block non-browser connections. If this happens you will need to contact your network administrators for Postman to work.

Can not send requests to localhost select a different agent in Postman?

Cloud Agent Error: Can not send requests to localhost. Select a different agent. Postman web version cannot able to send requests to the server that runs on your local PC(localhost). In order to send a request to the localhost URL, you need to install Postman desktop client.

What is host and localhost?

Localhost is a hostname that refers to the local machine currently making the request. On many computers, localhost is an alias for the IP address 127.0. 0.1. When a computer pings this IP address, it is communicating with itself.

Why does postman always use HTTP_proxy and HTTPS_proxy when using localhost?

When you issue a request to localhost respectively 127.0.0.1 it should bypass the web proxy. Postman seems to do so until you set the environment variables HTTP_PROXY and HTTPS_PROXY in Windows. By then it always uses these proxy settings even if you turn off system proxy in the options and even for localhost.

How to bypass localhost in Postman?

To do this go to Postman preferences > Proxy. You can also try sending a request in postman without typing localhost (e.g. :8080/send) i think i also found a perfect fix. First you turn on global proxy configurations, add your local machine Ip which is 127.0.0.1,then also add localhost in the bypass. Also turn off SSL verification.

Why is postman not connecting to my computer?

SO: If you’re using the free version of Postman, and you receive “connection refused” errors, then check whether you’re using a Personal or Team workspace. The problem may not have anything to do with your computer or its network configuration.

Why is my localhost not corresponding to my local server?

As we have mentioned earlier, one of the reasons the error message in question may appear is that, in some cases, the localhost isn’t corresponding to 127.0.0.1 which is the address of your local web server. In order to fix that problem, start the web server by launching XAMPP or WAMP and go to your browser and type 127.0.0.1 and press Enter .


2 Answers

I was having similar issue with HTTP calls to local ASP.NET Core Web API apps. Changing the proxy settings didn't fix it for me.

Finally fixed it by turning off File > Settings > General > SSL Certificate Verification

Hope that helps someone out there.

like image 171
Tonmoy Avatar answered Sep 21 '22 18:09

Tonmoy


I have the same issue. What works for me is:

Open File -> Settings -> Proxy

Then, enable proxy and put 127.0.0.1 : 80, if your web server runs on 80.

In the git thread, they say it is a known issue, so hopefully it will get resolved soon.

like image 36
Peter Matisko Avatar answered Sep 21 '22 18:09

Peter Matisko