“无法得到任何回应"使用带有子域的邮递员时的响应

编程入门 行业动态 更新时间:2024-10-23 18:26:36
本文介绍了“无法得到任何回应"使用带有子域的邮递员时的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用邮递员测试我拥有的 API,当请求不包含子域时一切都很好,但是当我将子域添加到 URL 时,我得到了这个响应.

无法得到任何回应

连接到

  • 关闭常规标签中的SSL证书验证:
  • 关闭代理选项卡中的全局代理配置和使用系统代理:
  • 将请求超时设为 0(零)
  • 配置Apache:

    如果上述更改导致 404 响应,则继续阅读;-)

    在本地托管其网站的用户(例如使用 XAMP 和/或 WAMP)可以使用 访问他们的虚拟网站 前缀地址,但这是一个谎言,真正启用 SSL(对于每个虚拟站点),配置 Apache 如下:

    • 在您喜欢的文本中打开 httpd-vhosts.conf 文件(来自 Apache 的 conf/extras 目录)-编辑.

    • 将虚拟站点的设置更改为:

      <VirtualHost *:80 *:443>服务器名称 my-site.local服务器别名 *.my-site.localDocumentRoot "C:xampphtdocsmy-projectpublic"SSLEngine 开启SSLCertificateFile "path/to/my-generated.cert"SSLCertificateKeyFile "path/to/my-generated.key"SetEnv APPLICATION_ENV "开发";<目录C:xampphtdocsmy-projectpublic">选项索引 FollowSymLinks允许覆盖所有命令允许,拒绝允许所有人</目录></虚拟主机>

      当然,生成一个虚拟 SSL 证书,并更改所有文件路径,例如从path/to/my-generated.cert"进入真实的文件地址.

    • 最后,在浏览器中访问本地站点进行测试,但使用(不带S)前缀地址;Apache 现在应该给出如下错误:

      错误请求您的浏览器发送了此服务器无法理解的请求.原因:您对启用 SSL 的服务器端口使用纯 HTTP.请改用 HTTPS 方案访问此 URL.

    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 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?

    解决方案

    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 prefixed address, but it's a lie, and to really enable SSL (for each virtual-site), configure Apache like:

    • Open httpd-vhosts.conf file (from Apache's conf/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:xampphtdocsmy-projectpublic" SSLEngine on SSLCertificateFile "path/to/my-generated.cert" SSLCertificateKeyFile "path/to/my-generated.key" SetEnv APPLICATION_ENV "development" <Directory "C:xampphtdocsmy-projectpublic"> 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 (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.

    更多推荐

    “无法得到任何回应"使用带有子域的邮递员时的响应

    本文发布于:2023-10-29 03:59:30,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1538659.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:邮递员   quot

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!