gpt4 book ai didi

subdomain - 使用带有子域的 postman 时的 "Could not get any response"响应

转载 作者:行者123 更新时间:2023-12-03 04:22:35 25 4
gpt4 key购买 nike

我正在使用 postman 来测试我拥有的 API,当请求不包含子域时一切都很好,但是当我向 URL 添加子域时我收到此响应。

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

如果我从 postman 复制相同的 URL 并将其粘贴到浏览器中,我会得到正确的响应,是否应该进行某种配置才能使 postman 使用子域?

最佳答案

首先转到Postman中的设置:

  1. 常规选项卡中关闭SSL证书验证:

  • 关闭代理选项卡中的全局代理配置使用系统代理:
  • 请求超时设置为 0(零)
  • 配置Apache:

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

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

    • 在您首选的文本编辑器中打开 httpd-vhosts.conf 文件(来自 Apacheconf/extras 目录) .

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

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

    • 最后,通过在浏览器中访问本地站点进行测试,但使用 http:// (不带 S)前缀地址; Apache 现在应该给出如下错误:
    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.

    关于subdomain - 使用带有子域的 postman 时的 "Could not get any response"响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47806876/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com