我有一個簡單的觀點如下:Django的視圖recieving不完整的POST有效載荷
@csrf_exempt
def stackcommits(request):
print request.body
return HttpResponse("")
發帖時映射到該視圖的URL,我的控制檯顯示不完整和破碎的有效載荷。它的大小應該是它的三分之一,即使如此,第三個對我來說也不是連續的,而是以幾個隨機部分交付。就像如下:
2014年9月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年9月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":"[email protected]: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的基礎設施問題,所以它很可能是我的最終目標。但我不知道什麼
你如何發佈?你可以發佈一些你發佈什麼/如何的代碼。 – awwester 2014-09-30 18:57:45
是的,事實上,這是Github webhook POSTs,我已經測試過Github使用以下方式正確發送它們: http://requestb.in/qhgo7nqh?inspect 您可以看到Github發送的有效負載 – user1079404 2014-09-30 19:00:32