Last updated: Apr 5, 2024
Reading time·5 min
The "Could not get any response" Postman error occurs for multiple reasons:
Authorization
request header incorrectlyhttps://
protocol instead of http://
when making a request to
localhost.HTTP_PROXY
and HTTPS_PROXY
environment variables.Here is the complete stack trace:
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
The first thing you should ensure is that Postman is configured correctly.
In the General tab, disable SSL certificate verification.
Make sure the Request timeout in ms setting is set to 0
.
Click on the Proxy tab.
Disable the This proxy requires authentication and Use the system proxy settings.
If you have ticked the This proxy requires authentication checkbox, make sure the provided username and password are correct and restart Postman.
If the error persists, try to enable the Use the system proxy setting and rerun the request.
Try to rerun the HTTP request after making these changes.
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:
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.
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 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.
# ✅ 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.
# Replace this http://localhost:5000 # With this http://127.0.0.1:5000
If the error persists, you should check if there are details about the error message in the Postman Console view.
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.
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.
# Windows CMD echo %http_proxy% echo %https_proxy%
And here are the commands for macOS and Linux.
# 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.
# 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.
# 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.
# 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.
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.
You can learn more about the related topics by checking out the following tutorials: