【问题标题】:Not able to make post request to native domain from chrome extension无法从 chrome 扩展向本机域发出 post 请求
【发布时间】:2013-12-30 03:54:57
【问题描述】:

描述 - 我有一个与 http://robustestom.appspot.com 绑定的网站 www.robustest.com。

当我试图从 chrome 扩展 Postman 向 /user/signup (robustest) 发出发布请求时,我收到以下错误

Request URL:http://robustest.com/user/signup
Request Method:POST
Status Code:301 Moved Permanently

**Response Header -**
Alternate-Protocol:80:quic
Content-Length:233
Content-Type:text/html; charset=UTF-8
Date:Mon, 30 Dec 2013 03:43:43 GMT
Location:http://www.robustest.com/user/signup
Server:ghs
X-Frame-Options:SAMEORIGIN
X-XSS-Protection:1; mode=block

但当我向http://robustestom.appspot.com/user/signup 开火时,它按预期工作。

我们为什么需要 - 我们正在扩展,我们需要针对我们的域发布请求。

调试 - 我可能错了,但似乎所有的帖子请求都重定向到他们的对应部分“GET”,因为来源不是“robustest.com”,而是一个“chrome 扩展”

【问题讨论】:

    标签: python google-app-engine google-chrome google-chrome-extension


    【解决方案1】:

    301 正在从 robustest.com 重定向到 www.robustest.com。将 www 添加到扩展程序发出请求的域中,301 错误应该会消失。

    【讨论】:

    • 我得到的是 301 而不是 302
    • 两者都是重定向代码,301 是永久的,而 302 是临时的。因为裸域永远不会是从应用引擎发送响应的位置,所以它会为您提供永久重定向。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-21
    • 2023-03-20
    • 1970-01-01
    • 2018-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多