简体   繁体   English

您无权在Python Eve中访问所请求的资源

[英]You don't have the permission to access the requested resource in Python Eve

When hitting the REST endpoint with DELETE ( http://localhost:5000/tax/559c0180b9f1f1072f240065 ), I receive an error. 使用DELETE( http:// localhost:5000 / tax / 559c0180b9f1f1072f240065 )访问REST端点时,收到错误。 The error was as follows. 错误如下。 Tax is the collection I'm attempting to delete and the following value in the URL is the id of the document I'd like deleted. Tax是我试图删除的集合,URL中的以下值是我要删除的文档的id。 Status 403 FORBIDDEN Show explanation Loading time: 7 Request headers Accept: application/json Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo CSP: active User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 Response headers Content-Type: application/json Content-Length: 180 Server: Eve/0.6-dev0 Werkzeug/0.10.4 Python/2.7.6 Date: Tue, 07 Jul 2015 16:46:40 GMT

{ _status: "ERR" _error: { message: "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server." code: 403 }- } { _status: "ERR" _error: { message: "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server." code: 403 }- } The payload I used was {"KONG": "Donkey"} { _status: "ERR" _error: { message: "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server." code: 403 }- }我使用的有效负载是{“KONG”:“Donkey”}

What can I do to resolve this issue? 我该怎么做才能解决这个问题?

The code I used is at the following links 我使用的代码位于以下链接

https://gist.github.com/anonymous/fda6080f3e7910d4be84 https://gist.github.com/anonymous/3bab73901f901087177b https://gist.github.com/anonymous/fda6080f3e7910d4be84 https://gist.github.com/anonymous/3bab73901f901087177b

You also need to provide a If-Match header (along with the document ETag ) with your request. 您还需要在请求中提供If-Match标头(以及文档ETag )。 See Data Integrity and Concurrency Control . 请参阅数据完整性和并发控制 By default Etags are required for all edit operations, but you can opt-out by simply setting IF-MATCH to False : 默认情况下,所有编辑操作都需要Etags,但您可以通过简单地将IF-MATCH设置为False来选择退出:

If your use case requires, you can opt to completely disable concurrency control. 如果您的用例需要,您可以选择完全禁用并发控制。 ETag match checks can be disabled by setting the IF_MATCH configuration variable to False (see Global Configuration). 可以通过将IF_MATCH配置变量设置为False来禁用ETag匹配检查(请参阅全局配置)。 When concurrency control is disabled no etag is provided with responses. 禁用并发控制时,不会为响应提供etag。 You should be careful about disabling this feature, as you would effectively open your API to the risk of older versions replacing your documents. 您应该小心禁用此功能,因为您有效地打开API会冒旧版本替换文档的风险。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python 网络抓取:您无权访问此资源 - python webscraping: You don't have permission to access this resource 您无权访问此资源 Python webscraping - You don't have permission to access this resource Python webscraping 发送帖子请求后,您无权访问所请求的资源错误 - You don't have the permission to access the requested resource error is geven when a post request is sent odoo 12错误-您没有访问所需资源的权限。 服务器已对其进行了读保护或不可读 - odoo 12 error - You don't have the permission to access the requested resource. It is either read-protected or not readable by the server Digital Ocean Forbidden 您无权访问此资源 - Digital Ocean Forbidden You don't have permission to access this resource 禁止您无权访问此资源。 PYTHON 上 Apache - Forbidden You don't have permission to access this resource. PYTHON on Apache python AsyncHTMLSession:您无权访问此服务器上的“XXX” - python AsyncHTMLSession: You don't have permission to access "XXX" on this server 部署 Django 应用程序:禁止您无权访问此资源 - Deploying Django app : Forbidden You don't have permission to access this resource Django - Apache - AWS --- 403 Forbidden:您无权访问此资源。 错误 - Django - Apache - AWS --- 403 Forbidden : You don't have permission to access this resource. error 拒绝访问 您无权访问 Selenium Python 中的站点 - Access Denied You don't have permission to access site in Selenium Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM