1
我想做一个POST调用包含JSON编码的形式。发送POST请求包含ecoded JSON
为什么我这样做?我没有选择,我正在工作的Facebook API,预计接收JSON编码的数据,并在接收JSON时发生错误。
var datas = JSON.stringify({ some: "JSON" });
request.post('https://graph.facebook.com/...', { form: datas }, function(error, response, body) {
//Fail before the callback call
});
如何避免:
做时,我得到了错误TypeError: stringify expects an object
?
不错,我不知道,谢谢! – Ludo