1
我试图将数据发布到我的Django服务器,但是当我检查服务器时,Querydict是空的。当我从浏览器中调用它看起来不错。Django发布请求数据
import requests
import json
headers = {
"AUTHORIZATION": "1234",
"Content-type": "application/json",
"Accept": "text/plain"
}
print headers
payload = {
"start_date_s":"04/01/2016",
"start_date_e":"04/15/2016"
}
r = requests.post('http://localhost:8000/get-ticket-data',headers=headers, json = json.dumps(payload))
print r.content
print r.text
data = json.dumps(有效载荷)或数据=有效载荷,在这两种情况下数据发送request.body – user1050619
我的坏..问题是内容类型的标头..我必须将其作为JS删除打开或将其更改为多种形式的数据 – user1050619