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.5.1 to 0.5.2

5

History.md
0.5.2 / 2013-09-23
==================
* add JSONResponseFormatError; append request url infomation to err.message
0.5.1 / 2013-08-23

@@ -3,0 +8,0 @@ ==================

@@ -193,2 +193,5 @@ /**

callback = null;
if (err) {
err.message += ', ' + options.method + ' ' + url;
}
cb(err, data, res);

@@ -295,2 +298,5 @@ };

} catch (e) {
if (e.name === 'SyntaxError') {
e.name = 'JSONResponseFormatError';
}
err = e;

@@ -297,0 +303,0 @@ }

2

package.json
{
"name": "urllib",
"version": "0.5.1",
"version": "0.5.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", "request", "https" ],

@@ -98,6 +98,8 @@ # urllib

if `Content-Type` header is not set.
If `Content-type` is `application/json`, the `data` will be `JSON.stringify` to JSON data format.
#### `options.content`
`options.content` is useful when you wish to construct the request body by yourself, for example making a `Content-Type: application/json` request.
`options.content` is useful when you wish to construct the request body by yourself,
for example making a `Content-Type: application/json` request.

@@ -113,4 +115,4 @@ Notes that if you want to send a JSON body, you should stringify it yourself:

content: JSON.stringify({
'a': 'hello',
'b': 'world'
a: 'hello',
b: 'world'
})

@@ -133,2 +135,17 @@ });

This exmaple can use `options.data` with `application/json` content type:
```js
urllib.request('http://example.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
data: {
a: 'hello',
b: 'world'
}
});
```
#### `options.stream`

@@ -150,3 +167,3 @@

stream: form
}, function (err, data) {
}, function (err, data, res) {
// upload finished

@@ -153,0 +170,0 @@ });

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