Comparing version 0.3.1 to 0.3.2
0.3.2 / 2012-11-08 | ||
================== | ||
* fixed #4 support urllib.request(options, args, callback) | ||
* fixed usage demo bug | ||
* fixed readme | ||
0.3.1 / 2012-11-05 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -41,3 +41,3 @@ /** | ||
* | ||
* @param {String} url | ||
* @param {String|Object} url | ||
* @param {Object} [args], optional | ||
@@ -67,4 +67,4 @@ * - {Object} [data]: request data, will auto be query stringify. | ||
args.timeout = args.timeout || exports.TIMEOUT; | ||
args.type = (args.type || args.method || 'GET').toUpperCase(); | ||
var info = urlutil.parse(url); | ||
var info = typeof url === 'string' ? urlutil.parse(url) : url; | ||
args.type = (args.type || args.method || info.method || 'GET').toUpperCase(); | ||
var method = args.type; | ||
@@ -82,3 +82,3 @@ var port = info.port || 80; | ||
var options = { | ||
host: info.hostname, | ||
host: info.hostname || info.host || 'localhost', | ||
path: info.path || '/', | ||
@@ -90,8 +90,8 @@ method: method, | ||
}; | ||
if (info.auth) { | ||
options.auth = info.auth; | ||
var auth = args.auth || info.auth; | ||
if (auth) { | ||
options.auth = auth; | ||
} | ||
if (args.auth) { | ||
options.auth = args.auth; | ||
} | ||
var body = args.content || args.data; | ||
@@ -98,0 +98,0 @@ if (!args.content) { |
{ | ||
"name": "urllib", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.", | ||
@@ -5,0 +5,0 @@ "keywords": [ "urllib", "http", "urlopen", "curl", "wget" ], |
@@ -27,3 +27,3 @@ # urllib [![Build Status](https://secure.travis-ci.org/TBEDP/urllib.png?branch=master)](http://travis-ci.org/TBEDP/urllib) | ||
### Upload file with `[formstream](https://github.com/fengmk2/formstream)` | ||
### Upload file with [`formstream`](https://github.com/fengmk2/formstream) | ||
@@ -48,3 +48,2 @@ ```js | ||
data.should.include('Content-Disposition: form-data; name="file"; filename="urllib.test.js"'); | ||
done(); | ||
}); | ||
@@ -51,0 +50,0 @@ |
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
11331
160
110