【问题标题】:127.0.0.1 works in Chrome but doesn't work in Edge127.0.0.1 适用于 Chrome,但不适用于 Edge
【发布时间】:2020-10-11 17:54:27
【问题描述】:

我使用 Golang 构建了一个简单的 Web API,需要对其进行测试。

首先我尝试在 Chrome 中调用 API:http://127.0.0.1:8080/balances - 完美运行。

我尝试调用 Postman:http://127.0.0.1:8080/balances - 不起作用 - 找不到 Web API。所以我改成 http://localhost:8080/balances 就可以了。

认为是 Postman 的问题,所以在 Microsoft Edge 上进行了尝试。 127.0.0.1 不起作用,localhost 起作用。

所以 127.0.0.1 唯一有效的浏览器是 Chrome。

不确定这里发生了什么。我应该怎么做才能使 127.0.0.1 在包括 Edge 和 Postman 在内的所有 Web 客户端中工作?

【问题讨论】:

标签: windows rest google-chrome go postman


【解决方案1】:

检查 Edge 中的代理绕过设置,确保它设置为 localhost 的代理绕过。接下来检查 C:\windows\system32\drivers\etc\hosts 文件并确保存在 localhost 条目。

【讨论】:

  • Edge 中的绕过设置在哪里?我试过编辑主机,但它不起作用。
猜你喜欢
  • 1970-01-01
  • 2019-11-15
  • 1970-01-01
  • 2016-08-03
  • 1970-01-01
  • 2019-10-26
  • 1970-01-01
  • 1970-01-01
  • 2023-01-14
相关资源
最近更新 更多