[英]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.