jsonp 和 POST 操作

发布于 2024-10-07 01:32:19 字数 120 浏览 0 评论 0原文

从这里阅读我知道,不可能使用 jsonp 和 javascript 执行跨域 POST 操作。 但我必须使用 javascript 将数据写回位于不同域的 Web 服务 - 其他人是如何做到的?只需破解它并使用 GET 操作?

I know from reading on here that it is not possible to do a cross domain POST action using jsonp and javascript.
But I have to write back data to a web service that's on a different domain using javascript - how do others do it? Just hack it and use a GET action?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

扶醉桌前 2024-10-14 01:32:19

写一个代理,超级简单。

Write a proxy, it is super simple.

剪不断理还乱 2024-10-14 01:32:19

我最终只是使用 GET 方法并将我的详细信息发回。这不是 REST 应该使用的方式,但经过调查,许多其他网站似乎都是这样做的。

I've ended up just using a GET method and sending my details back. Not the way REST is supposed to be used but on investigation this is what a number of other web sites seem to do.

晨曦慕雪 2024-10-14 01:32:19

url 有何不同?根据答案,您也许可以使用 javascript 来完成此操作。假设同源策略确实适用,一种方法是发布到提供该页面的服务器,然后在服务器上使用 http 库发布到其他系统。

how different are the urls? Depending on the answer you might be able to do it with javascript. Assuming that the same origin policy does indeed apply, one way would be to post to the server that served the page, and then on the server use an http library to post to the other system.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文