node.js做app store支付收据的二次验证
var postdata =
{
method: 'POST',
uri: 'https://sandbox.itunes.apple.com/verifyReceipt',
multipart:
[
{ 'content-type': 'text/plain; charset=ISO-8859-1',
'body': "{\"receipt-data\":\""+reciept+"\"}"
}
]
};
request(postdata, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("bodytostring---"+JSON.stringify(body));
console.log("body---"+body);
callback1(JSON.parse(body));
}
});
但是总是返回21002.有哪位大神指点下