By Yahya Hussein


2017-12-14 06:07:13 8 Comments

I am using postman to test an API I have, all is good when the request does not contain sub-domain, however when I add a sub-domain to URL I am getting this response.

Could not get any response

There was an error connecting to http://subdomain.localhost:port/api/

Why this might have happened:

The server couldn't send a response:Ensure that the backend is working properly

Self-signed SSL certificates are being blocked:Fix this by turning off 'SSL certificate verification' in Settings > General

Proxy configured incorrectly Ensure that proxy is configured correctly in Settings > Proxy

Request timeout:Change request timeout in Settings > General

If I copy the same URL from postman and paste it into the browser I get a proper response, is there some kind of configurations I should do to make postman work with sub-domains?

13 comments

@gsumk 2019-02-27 22:11:30

None of these solutions works for me. Postman is not sending any request to the server because postman is not finding the host. So, if you modify your /etc/hosts to 127.0.0.1 localhost 127.0.0.1 subdomain.localhost

It works for me.

@JSWilson 2019-02-05 19:25:52

For me what worked was to add 127.0.0.1 subdomain.localhost to my host file. On OSX that was /etc/hosts. Not sure why that was necessary as I could reach the subdomain from chrome.

@Harmlezz 2019-01-28 13:46:04

Postman for Linux Version 6.7.1 - Ubuntu 18.04 - linux 4.15.0-43-generic / x64

I had the same problem and by chance I replaced http://localhost with http://127.0.0.1 and everything worked.

My etc/hosts had the proper entries for localhost and https://localhost requests always worked as expected.

I have no clue why changing localhost for http with 127.0.0.1 solved the issue.

@Subramanian Sridharan 2019-01-17 07:21:06

Unchecking proxy and SSL Certificate Verification didn't work for me.

Unsetting PROXY environment variables did the trick.

export http_proxy=
export ftp_proxy=
export https_proxy=

Change to the directory where Postman is installed and then:

./Postman

@Sayantan Ganguly 2019-01-15 12:28:57

After all the above methods like turning OFF SSL certificate verification, turning ON only Use System Proxy and removing HTTP_PROXY and HTTPS_PROXY system environment variables, it worked.

Note: Had to restart the Postman app, since the environment variables were changed.

@Cool.wen 2019-01-04 07:25:54

I had the same issue. It was caused by a newline at the end of the "Authorization" header's value, which I had set manually by copy-pasting the bearer token (which accidentally contained the newline at its end)

@Xiao 2019-01-18 02:10:24

Same here, mine was on a custom header. Removed the extra newline, everything's fine.

@Jesuisme 2019-03-17 05:10:17

Somewhat related: I had my requests grouped in a collection, using a common url variable across all the requests. I accidentally erased the variable name (even though the url values were still there) and got the error mentioned in the OP.

@kishor soneji 2018-12-15 06:30:35

Hi This issue is resolved for me.

setting ->general -> Requesttimeout in ms = 0

@GeekMustHave 2018-11-15 15:56:36

You mentioned you are using a CER certificate.

According to the Postman page on certificates.

Choose your client certificate file in the CRT file field. Currently, we only support the CRT format. Support for other formats (like PFX) will come soon.

The name of the extension CER, CRT doesn't make the certificate that type of certificate but, these are the excepted extensions names.

CER is an X.509 certificate in binary form, DER encoded.

CRT is a binary X.509 certificate, encapsulated in text (base-64) encoding.

You can use OpenSSL to change a CER file into a CRT file. I have not had good luck with it but it looks like this.

openssl x509 -inform PEM -in certificate.cer -out certificate.crt

or

openssl x509 -inform DER -in certificate.cer -out certificate.crt

@Udit Jain 2018-11-08 10:41:56

For me it was the http://localhost instead of https://localhost.

@pan1490 2019-02-27 13:11:33

You saved my day !That worked perfectly !!

@arjuncc 2018-10-12 08:56:07

If all above methods doesn't work check your environment variables, And make sure that the following environments are not set. If those are set and not needed by any other application remove them.

HTTP_PROXY
HTTPS_PROXY

Reference link

@Ramesh R 2018-02-27 13:27:31

First Go to Settings in Postman:

enter image description here

1) Off the SSL certificate verification in General Tab: enter image description here

2) Off the Global Proxy Configuration and Use System Proxy in Proxy Tab enter image description here

@Yahya Hussein 2018-02-27 13:43:05

Did not work :(

@Ramesh R 2018-02-27 13:59:24

Have you followed all steps, Just now i modified it worked for me

@Yahya Hussein 2018-02-28 06:24:26

Yes, I did, did not work for me

@Abdullah Tahan 2018-10-10 12:04:17

i don't have those options !

@Abdullah Tahan 2018-10-10 12:16:04

if you don't have ssl option you have to download postman from here : www.getpostman.com

@Ramesh R 2018-10-10 12:16:32

You can try for Settings in Postman

@Ramesh R 2018-10-10 12:20:10

@Nirman 2018-12-20 16:15:19

worked like a charm :) Fantastic. Somehow I had issues while testing my APIs on localhost. This helped!

@user3820753 2019-02-13 04:41:00

Just turning off the ssl certification worked for me

@ayed abboushi 2019-03-01 13:44:32

it works, thank you.

@Thamaraiselvam 2019-03-06 07:45:54

Saved my hours..

@ContextSwitch 2018-05-31 20:19:39

For me, it was that route that I was calling in my node server wasn't returning anything. Adding

    return res.status(200).json({
        message: 'success!',
        response: 'success!'
    });//

to the route I was calling resolved the issue.

@user8709803 2018-01-31 20:58:11

When getting the following error, enter image description here

you need to do the following.

Step 1: In Postman, click the wrench icon, go to settings, then go to the Proxy tab.

Step 1 Wrench Icon > Settings > Proxy Tab

Step 2: Create a custom Proxy. This article explains how to create a custom proxy. After you create the custom Proxy, make sure you turn the Proxy toggle button to off. I put 61095 in for the proxy server and it worked for me.

enter image description here

Step 3 :

Success

Success

@robross0606 2019-02-05 20:16:59

Can you explain why a Proxy would be necessary to access a server on the local network that is having this problem?

Related Questions

Sponsored Content

1 Answered Questions

1 Answered Questions

Postman refuses to work when Authorization header is present

  • 2018-05-31 08:31:08
  • hoodakaushal
  • 105 View
  • 2 Score
  • 1 Answer
  • Tags:   rest postman

0 Answered Questions

Transposing MWS settings to Postman

1 Answered Questions

Error in Postman i.e. Could not get any response

  • 2018-10-28 12:53:56
  • Amol Borkar
  • 895 View
  • -2 Score
  • 1 Answer
  • Tags:   postman

0 Answered Questions

Error receiving request from client: SSLHandshakeFailed: SSLHandshakeFailed

2 Answered Questions

0 Answered Questions

configure ".cer" certificate in Postman

1 Answered Questions

[SOLVED] Unable to access web api remotely

0 Answered Questions

How to use Postman with OSWAP Zap Proxy?

  • 2017-11-14 14:28:52
  • dmz73
  • 395 View
  • 3 Score
  • 0 Answer
  • Tags:   rest postman zap

Sponsored Content