Could not get any response Postman Error [Solved]

avatar
Borislav Hadzhiev

Last updated: Apr 5, 2024
5 min

banner

# Could not get any response Postman Error [Solved]

The "Could not get any response" Postman error occurs for multiple reasons:

  • failed certificate verification
  • incorrect proxy configuration
  • the request has timed out
  • setting the Authorization request header incorrectly
  • using the https:// protocol instead of http:// when making a request to localhost.
  • pulling incorrect proxy configuration from the HTTP_PROXY and HTTPS_PROXY environment variables.

Here is the complete stack trace:

shell
Could not get any response There was an error connecting to 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

# Configuring Postman correctly

The first thing you should ensure is that Postman is configured correctly.

  1. Click on the cogwheel icon in the top right corner and select Settings.

click cogwheel settings

  1. In the General tab, disable SSL certificate verification.

  2. Make sure the Request timeout in ms setting is set to 0.

disable ssl certification verification

  1. Click on the Proxy tab.

  2. Disable the This proxy requires authentication and Use the system proxy settings.

disable this proxy requires authentication use the system proxy

If you have ticked the This proxy requires authentication checkbox, make sure the provided username and password are correct and restart Postman.

  1. In older versions of Postman you'll see a Global Proxy Configuration setting instead. Make sure to disable the setting.

If the error persists, try to enable the Use the system proxy setting and rerun the request.

try enable use system proxy

Try to rerun the HTTP request after making these changes.

# Make sure the values of your request headers are correct

Another common cause of the error is adding a newline at the end of an HTTP request header value.

This can happen if you copy-paste the value of the Authorization header or any other header.

Click on the Headers tab for the specific request and check:

  1. that the value of each header doesn't have a newline after it.
  2. that the value of each header is correct.

check headers section

If you end up removing trailing newlines from the values of your headers or correct any values, try to rerun the request and check if the error is resolved.

You should also check the key of each header for any leading or trailing whitespace characters and newlines.

Make sure the keys and values of the headers are correct and don't have any leading or trailing whitespace and newlines.

You can also try to rewrite the header keys to make sure there aren't any invisible characters that you have copy-pasted from somewhere.

# Make sure the protocol and the URL are correct

Make sure the protocol and the URL and path to which you're making a request are correct.

For example, the error occurs if you make a request to https://localhost:5000 instead of http://localhost:5000.

Notice that the first URL uses HTTPS which is incorrect unless you use a local certificate for localhost.

shell
# ✅ Correct (uses http:// for localhost) http://localhost:5000 # ⛔️ Incorrect (uses https:// for localhost) https://localhost:5000

Make sure the protocol, URL, all path components, query parameters and the port are correct and rerun the request.

Conversely, if you are making a request to a server that requires you to use SSL, make sure to set the protocol to https:// and not http://.

Another thing you can try is to replace http://localhost with http://127.0.0.1 if you got the request when making requests to localhost.

shell
# Replace this http://localhost:5000 # With this http://127.0.0.1:5000

# Check what error you get in the Postman console

If the error persists, you should check if there are details about the error message in the Postman Console view.

  1. Click on View in the top menu and select Show Postman Console.

view show postman console

  1. Rerun the HTTP request and check out the output in the console.

The error message in the console should give you more information about what the issue is.

For example, if the key or value of an HTTP header is incorrect, you might get additional information as to which header is the cause of the error.

If you run into issues with certificate verification, you might have to disable certificate verification in Postman as shown in the first subheading.

If you get the Unable to verify the first certificate error, click on the link and follow the instructions.

# Clear your proxy settings

If the error persists, you might have to clear your proxy settings.

Your proxy settings might be pulled from the http_proxy and https_proxy environment variables.

You can run the following command to check if the environment variables are set on your machine.

Here are the commands for Windows CMD.

shell
# Windows CMD echo %http_proxy% echo %https_proxy%

And here are the commands for macOS and Linux.

shell
# macOS and Linux echo $http_proxy echo $https_proxy

If you need to clear your proxy-related environment variables on Windows, run the following commands.

cmd
# for Windows CMD (Command Prompt) set http_proxy=null set https_proxy=null set HTTP_PROXY=null set HTTPS_PROXY=null

If you use PowerShell on Windows, you would run the following commands instead.

PowerShell
# for Windows CMD (PowerShell) [Environment]::SetEnvironmentVariable('http_proxy', '', 'User') [Environment]::SetEnvironmentVariable('http_proxy', '', 'Machine') [Environment]::SetEnvironmentVariable('https_proxy', '', 'User') [Environment]::SetEnvironmentVariable('https_proxy', '', 'Machine')

If you are on macOS or Linux, use the unset command to clear the environment variables.

shell
# for macOS, Linux or Windows Git Bash unset http_proxy unset https_proxy unset HTTP_PROXY unset HTTPS_PROXY

Try to restart Postman after unsetting the environment variables and rerun the request.

# Make sure your backend is able to respond to requests

If the error persists, make sure that the server you are making HTTP requests to is able to respond.

You might get the error if your server times out or is misconfigured.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.