Comparing version 0.3.6 to 0.3.7
0.3.7 / 2013-07-11 | ||
================== | ||
* PATCH method is also "application/x-www-form-urlencoded" by default | ||
* replace logo | ||
0.3.6 / 2013-07-11 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -106,3 +106,3 @@ /** | ||
body = qs.stringify(body); | ||
if (method === 'POST' || method === 'PUT') { | ||
if (method === 'POST' || method === 'PUT' || method === 'PATCH') { | ||
// auto add application/x-www-form-urlencoded when using urlencode form request | ||
@@ -109,0 +109,0 @@ if (!options.headers['Content-Type'] && !options.headers['content-type']) { |
{ | ||
"name": "urllib", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"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" ], |
@@ -7,4 +7,2 @@ # urllib [![Build Status](https://secure.travis-ci.org/TBEDP/urllib.png?branch=master)](http://travis-ci.org/TBEDP/urllib) [![Coverage Status](https://coveralls.io/repos/TBEDP/urllib/badge.png)](https://coveralls.io/r/TBEDP/urllib) | ||
* jscoverage: [99%](http://fengmk2.github.com/coverage/urllib.html) | ||
## Install | ||
@@ -22,4 +20,8 @@ | ||
urllib.request('http://cnodejs.org/', { wd: 'nodejs' }, function (err, data, res) { | ||
if (err) { | ||
throw err; // you need to handle error | ||
} | ||
console.log(res.statusCode); | ||
console.log(res.headers); | ||
// data is Buffer instance | ||
console.log(data.toString()); | ||
@@ -76,3 +78,5 @@ }); | ||
For `POST` or `PUT` request, in defaults, the `data` will be stringify into `application/x-www-form-urlencoded`. | ||
For `POST`, `PATCH` or `PUT` request, | ||
in defaults, the `data` will be stringify into `application/x-www-form-urlencoded` format | ||
if `Content-Type` header is not set. | ||
@@ -89,3 +93,3 @@ #### `options.content` | ||
headers: { | ||
'content-type': 'application/json' | ||
'Content-Type': 'application/json' | ||
}, | ||
@@ -92,0 +96,0 @@ content: JSON.stringify({ |
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
17840
182