CORS与POSTMAN [英] CORS with POSTMAN

查看:1154
本文介绍了CORS与POSTMAN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此主题已被问过几次,但我还是不明白的:

This subject has been asked a couple of time, but I still don't understand something:

当我阅读有关


没有Access-Control-Allow-Origin头

No 'Access-Control-Allow-Origin' header

它表示应该在请求的服务器上设置一个设置,以允许跨域: add_header'Access-Control-Allow-Origin''*';

issue, it says a setting should be set on the requested server in order to allow cross domain: add_header 'Access-Control-Allow-Origin' '*';.

但是,请告诉我为什么当从邮递员(这是一个客户端)询问时,它的工作方式像一个魅力,我有一个从所请求的服务器的响应?

But, please tell me why when asking from postman (which is a client), It's working like a charm and I have a response from the requested server?

谢谢

推荐答案

原因是:


Postman不关心SOP,它是一个开发工具而不是浏览器

Postman doesn't care about SOP, it's a dev tool not a browser

顺便说一句, chrome扩展,以使其在您的浏览器上工作(这一个是chrome,但你可以找到FF或Safari)

By the way here's a chrome extension in order to make it work on your browser (this one is for chrome, but you can find either for FF or Safari).

如果您需要,请检查此处详细了解跨源以及为什么它适用于扩展程序。

Check here if you want to learn more about Cross-Origin and why it's working for extensions.

这篇关于CORS与POSTMAN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆