“Could not get any response” response when using postman with subdomain

大憨熊 提交于 2019-11-26 12:16:59

问题


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?


回答1:


First Go to Settings in Postman:

1) Off the SSL certificate verification in General Tab:

2) Off the Global Proxy Configuration and Use System Proxy in Proxy Tab




回答2:


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)




回答3:


If you get a "Could not get any response" message from Postman native apps while sending your request, open Postman Console (View > Show Postman Console), resend the request and check for any error logs in the console.

Thanks to numaanashraf




回答4:


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




回答5:


Hi This issue is resolved for me.

setting ->general -> Requesttimeout in ms = 0




回答6:


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




回答7:


I came up with this solution

  1. In postman go to setting --> proxy
  2. And off Global Proxy Configuration
  3. on the Use System Proxy

  4. And go to windows host configure file 'C:\Windows\System32\drivers\etc\hosts'

  5. Open that file in administrator mode
  6. And add the sub domain to hosts file



回答8:


When getting the following error,

you need to do the following.

Step 1: In Postman, click the wrench icon, go to settings, then go to the 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.

Step 3 :

Success




回答9:


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.




回答10:


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.




回答11:


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




回答12:


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.




回答13:


For me the issue was that the Content-Length was too big. I placed the content of the body in NotePad++ and counted the characters and put that figure in PostMan and then it worked.

I know it does not directly answer why the op's sub-domain was not working but it might help out someone.




回答14:


  1. In postman go to setting --> proxy
  2. And off Global Proxy Configuration




回答15:


For anyone who experienced this issue with real domain instead of localhost and couldn't solve it using ANY OF THE ABOVE solutions.

Try changing your Network DNS (WIFI or LAN) to some other DNS. For me, I used Google DNS 8.8.8.8, 8.8.4.4 and it worked!




回答16:


solution is very simple if you are using asp.net core 2 application . Inside ConfigureServices method inside startup.cs file all this line

services.AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
                .AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);



回答17:


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.




回答18:


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



回答19:


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.




回答20:


In my case it was invisible spaces that postman didn't recognize, the above string of text renders as without spaces in postman. I disabled SSL certificate Validation and System Proxy even tried on postman chrome extension(which is about to be deprecated), but when I downloaded and tried Insomnia and it gave those red dots in the place where those spaces were, must have gotten there during copy/paste




回答21:


In my case, MVC wasn't able to serialize the results (I accidentally used a model instead of DTO). I debugged down to passing a simple string, which worked. Once I fixed the serialization it all came up.




回答22:


In my case the (corporate) proxy was using a self-signed SSL certificate which Postman disliked. I discovered it by activating View->Show Postman console and retrying the request. The console then showed the certificate error. In Settings->General I disabled SSL certificate verification.




回答23:


The solution for me, as I'm using the deprecated Postman extension for Chrome, to solve this issue I had to:

  1. Call some GET request using the Chrome Browser itself.
  2. Wait for the error page "Your connection is not private" to appear.
  3. Click on ADVANCED and then proceed to [url] (unsafe) link.

After this, requests through the extension itself should work.




回答24:


In my case it was a misconfigured subnet. Only one of the 2 subnets in the ELB worked.

I figured this out by doing a nslookup and trying to curl the returned IPs directly. Only one worked. Postman just kept using the misconfigured one.



来源:https://stackoverflow.com/questions/47806876/could-not-get-any-response-response-when-using-postman-with-subdomain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!