我创建一个节点服务器,我必须记录它所做的一切。我使用Requestify来做POST请求。
requestify.request(uriGoogleApi, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=' + serverKey
},
body: {
"notification": {
"title": prefix + news.title,
"body": news.highlight,
"sound": "default",
"click_action": "FCM_PLUGIN_ACTIVITY",
"icon": "",
"content_available": true
},
"data": {
"url": news.newsUrl,
"id": news.id,
"type": "news"
},
"condition": jobs,
"priority": priority
}
}).then(function (response) {
console.log("==> pushNews : " + news.id);
console.debug("Content news pushed: " + JSON.stringify(news));
}).fail(function (err) {
console.log(err);
console.debug(JSON.stringify(news));
});
如何获取整个JSON请求? (不是回复而是请求)