mirror of
https://github.com/HackPlan/node-iap.git
synced 2026-06-17 02:25:19 +08:00
finished implementation of code to follow documentation. Also made fixes as per pr comments
This commit is contained in:
@@ -10,14 +10,12 @@ module.exports = function (url, options, cb) {
|
||||
try {
|
||||
if (options.form) {
|
||||
data = formUrlencoded.encode(options.form);
|
||||
delete options.form;
|
||||
options.headers = {
|
||||
'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)
|
||||
|
||||
Reference in New Issue
Block a user