Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urllib

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urllib - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

6

History.md
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 @@ ==================

2

lib/urllib.js

@@ -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({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc