mirror of
https://github.com/HackPlan/node-iap.git
synced 2026-06-14 08:59:15 +08:00
refactored the code a bit to use new https request library
This commit is contained in:
@@ -15,6 +15,13 @@ module.exports = function (url, options, cb) {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'content-length': Buffer.byteLength(data)
|
||||
};
|
||||
} else if (data.json) {
|
||||
data = JSON.stringify(data.json);
|
||||
delete options.json;
|
||||
options.headers = {
|
||||
'content-type': 'application/json',
|
||||
'content-length': Buffer.byteLength(data)
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
cb(error);
|
||||
|
||||
Reference in New Issue
Block a user