Comparing version 0.1.1 to 0.1.2
14
index.js
@@ -21,2 +21,10 @@ var curl = null; | ||
client.setUserAgent(value); | ||
break; | ||
case 'timeout': | ||
if (Array.isArray(value)) { | ||
client.setTimeout(value[0], value[1]); | ||
} else { | ||
client.setTimeout(value); | ||
} | ||
break; | ||
case 'headers': | ||
@@ -38,8 +46,8 @@ for (const name in value) { | ||
} | ||
return new Promise(resolve => { | ||
return new Promise((resolve, reject) => { | ||
const client = new curl.Client(options); | ||
setOptions(client, options); | ||
client.get(url, (err, res) => { | ||
if (err) throw err; | ||
resolve(res); | ||
if (err) reject(err); | ||
else resolve(res); | ||
}); | ||
@@ -46,0 +54,0 @@ }); |
{ | ||
"name": "http-curl", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19882
51