我有一个简单的看法如下:
@csrf_exempt
def stackcommits(request):
print request.body
return HttpResponse("")
当我 POST 到映射到此视图的 URL 时,我的控制台显示了一个不完整且损坏的有效负载。它大约是它应有的尺寸的三分之一,即使如此,对我来说第三个也不是连续的,而是随机交付的。如下:
2014-09-30 18:47:21
<QueryDict: {u'payload': [u'{"zen":"Avoid administrative distraction.","hook_id":3103635,"hook":{"url":"https://api.github.com/repos/valeyard/SearchDemon/hooks/3103635","test_url":"https://api.github.com/repos/valeyard/SearchDemon/hooks/3103635/test","id":3103635,"name":"web","active":true,"events":["push"],"config":{"secret":"","url":"http://searchdemon.pythonanywhere.com/searchdemon/stackcommits/","content_type":"json","insecure_ssl":"0"},"last_response":{"code":null,"status":"unused","message":null},"updated_at":"2014-09-29T20:56:33Z","created_at":"2014-09-29T20:56:33Z"},"repository":{"id":24075885,"name":"SearchDemon","full_name":"valeyard/SearchDemon","owner":{"login":"valeyard","id":5278331,"avatar_url":"https://avatars.githubusercontent.com/u/5278331?v=2","gravatar_id":"","url":"https://api.github.com/users/valeyard","html_url":"https://github.com/valeyard","followers_url":"https://api.github.com/users/valeyard/followers",
2014-09-30 18:47:21
.github.com/repos/valeyard/SearchDemon/issues{/number}","pulls_url":"https://api.github.com/repos/valeyard/SearchDemon/pulls{/number}","milestones_url":"https://api.github.com/repos/valeyard/SearchDemon/milestones{/number}","notifications_url":"https://api.github.com/repos/valeyard/SearchDemon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/valeyard/SearchDemon/labels{/name}","releases_url":"https://api.github.com/repos/valeyard/SearchDemon/releases{/id}","created_at":"2014-09-15T22:10:54Z","updated_at":"2014-09-24T17:12:44Z","pushed_at":"2014-09-29T20:42:34Z","git_url":"git://github.com/valeyard/SearchDemon.git","ssh_url":"git@github.com:valeyard/SearchDemon.git","clone_url":"https://github.com/valeyard/SearchDemon.git","svn_url":"https://github.com/valeyard/SearchDemon","homepage":null,"size":1172,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":tr
有任何想法吗?有人告诉我,这不是 PA 的基础设施问题,所以很可能是我的问题。但我不知道是什么