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
properlySelf-signed SSL certificates are being blocked:Fix this by turning off
‘SSL certificate verification’ in Settings > GeneralProxy configured incorrectly Ensure that proxy is configured correctly
in Settings > ProxyRequest 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?
33 Answers
First Go to Settings in Postman:
- Off the SSL certificate verification in General Tab:
- Off the Global Proxy Configuration and Use System Proxy in Proxy Tab:
- Make Request Timeout to 0 (Zero)
Configure Apache
:
If above changes resulted in 404
response, then continue reading 😉
Users that host their site locally (like with XAMP
and/or WAMP
), may be able to visit their virtual-sites using https://
prefixed address, but it’s a lie, and to really enable SSL
(for each virtual-site), configure Apache like:
-
Open
httpd-vhosts.conf
file (fromApache
‘sconf/extras
directory), in your preferred text-editor. -
Change virtual-site’s settings, into something like:
<VirtualHost *:80 *:443> ServerName my-site.local ServerAlias *.my-site.local DocumentRoot "C:\xampp\htdocs\my-project\public" SSLEngine on SSLCertificateFile "path/to/my-generated.cert" SSLCertificateKeyFile "path/to/my-generated.key" SetEnv APPLICATION_ENV "development" <Directory "C:\xampp\htdocs\my-project\public"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
But of course, generate a dummy-SSL-certificate, and change all file-paths, like from “
path/to/my-generated.cert
” into real file-addresses. -
Finally, test by visiting local-site in browser, but using
http://
(without S) prefixed address; Apache should now give error like:Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.