我发现了一个看起来也不太好的行为:我使用 python-eve 更新了一条记录,因为我发送了一些不应该发送的字段而出现错误,但这不是问题。我发现即使出现错误并且响应正文显示与其相关的消息,http 响应状态为 200。
我不确定这是错误还是标准行为,我预计会收到一些 4xx 错误验证失败。
任何想法?
谢谢加斯顿
_
Request URL:http://127.0.0.1:5000/players/52ed7a53a54d75bf68c1b720
Request Method:PUT
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,es;q=0.6
Authorization:Basic YWRtaW46c2VjcmV0
Cache-Control:no-cache
Connection:keep-alive
Content-Length:335
Content-Type:application/json
Cookie:roles="[\"operator\"\054\"admin\"]"
Host:127.0.0.1:5000
If-Match:eeadcc62ad252697c9b109c00cae771c0690c172
Origin:http://127.0.0.1:5000
Pragma:no-cache
Referer:http://127.0.0.1:5000/static/index.html
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
X-Requested-With:XMLHttpRequest
Request Payloadview source
{_updated:2014-02-01T22:50:59.000Z, name:gas1e, score:260, _tenant:tonga.net,…}
_created: "2014-02-01T22:50:59.000Z"
_etag: "eeadcc62ad252697c9b109c00cae771c0690c172"
_issues: {_updated:unknown field, _created:unknown field, _status:unknown field, _issues:unknown field,…}
_status: "ERR"
_tenant: "tonga.net"
_updated: "2014-02-01T22:50:59.000Z"
name: "gas1e"
score: 260
Response Headersview source
Access-Control-Allow-Headers:
Access-Control-Allow-Max-Age:21600
Access-Control-Allow-Methods:HEAD, GET, PUT, POST, DELETE, OPTIONS, PATCH
Access-Control-Allow-Origin:*
Content-Length:171
Content-Type:application/json
Date:Sun, 02 Feb 2014 05:16:09 GMT
Server:Werkzeug/0.9.4 Python/2.7.5
Response Payloadview source
_issues: {_updated:unknown field, _created:unknown field, _status:unknown field, _issues:unknown field,…}
_created: "unknown field"
_etag: "unknown field"
_issues: "unknown field"
_status: "unknown field"
_updated: "unknown field"
_status: "ERR"