【发布时间】:2016-11-09 16:44:29
【问题描述】:
我收到此错误
ChunkedEncodingError: ('Connection broken: IncompleteRead(14 bytes read)', IncompleteRead(14 bytes read))
我正在使用 python 从 Google App Engine 中的“请求”库(第 3 方)发出 POST 请求。
url = 'https://fcm.googleapis.com/fcm/send'
body = {
"data": {
"title": "data:mytitle",
"body": "data:mybody",
"url": "data:myurl"
},
"notification": {
"title": "noti:My web app name",
"body": "noti:message",
"content_available": "noti:true"
},
"message": "test",
"registration_ids": ["xxxxxxxxxxxxxxxxxxxx"]
}
headers = {"Content-Type": "application/json",
"Authorization": "key=xxxxxxxxxxxxxxxx"}
logging.error(json.dumps(body))
requests.post(url, data=json.dumps(body), headers=headers)
【问题讨论】:
标签: python google-app-engine python-requests