有什么方法可以阻止 Postman 在 .NET Core 中发出的 HTTP 请求? [英] Is there any way to block HTTP requests made by Postman in .NET Core?

查看:54
本文介绍了有什么方法可以阻止 Postman 在 .NET Core 中发出的 HTTP 请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道是否有任何方法可以阻止 POSTMAN 发出的 HTTP 请求?就像浏览器在 CORS 的帮助下只允许特定的来源访问资源.提前致谢.

I just wanted to know whether is there any way block to HTTP requests made by POSTMAN? Just like browser with the help of CORS allows only specific origins to access a resource. Thanks in advance.

推荐答案

没有.

在 CORS 中,阻止请求(或回答)是浏览器的工作,您的服务器不知道请求的真相".如果某些高级用户将在浏览器设置/标志中禁用遵循 CORS 规则" - 您的 CORS 设置将被忽略.

In CORS, it's browser job to block request (or answer), your server does not know "truth" about request. If some power user will disable "following CORS rules" in browser settings/flags - your CORS settings will be ignored.

即使您会发现一些 POSTMAN 会理解"并拒绝工作的特殊标头" - 还有许多其他客户端"可以将 http(s) 请求发送到服务器(curl、Fiddler、...).

And even if you will find some "special headers" that POSTMAN will "understand" and refuse to work - there are many other "clients" that can send http(s) requests to server (curl, Fiddler, ...).

这篇关于有什么方法可以阻止 Postman 在 .NET Core 中发出的 HTTP 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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