cheerio-httpcli
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -138,3 +138,6 @@ /*jshint node:true, forin:false */ | ||
if (err) { | ||
return callback(_fetchError(err, { url: url }), undefined, res); | ||
return callback(_fetchError(err, { | ||
url: url, | ||
param: param | ||
}), undefined, res); | ||
} | ||
@@ -144,3 +147,4 @@ if (!body) { | ||
statusCode: res.statusCode, | ||
url: url | ||
url: url, | ||
param: param | ||
}), undefined, res); | ||
@@ -159,3 +163,7 @@ } | ||
} catch (e) { | ||
return callback(_fetchError(e, { charset: enc, url: url }), res); | ||
return callback(_fetchError(e, { | ||
charset: enc, | ||
url: url, | ||
param: param | ||
}), res); | ||
} | ||
@@ -170,3 +178,4 @@ } | ||
statusCode: res.statusCode, | ||
url: url | ||
url: url, | ||
param: param | ||
}); | ||
@@ -173,0 +182,0 @@ } |
{ | ||
"name": "cheerio-httpcli", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "html client module with cheerio & iconv", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,5 +23,5 @@ # cheerio-httpcli | ||
* Errorオブジェクト | ||
* `cheerio.load()`でHTMLコンテンツをパースしたオブジェクト | ||
* requestモジュールの`response`オブジェクト | ||
1. Errorオブジェクト | ||
2. `cheerio.load()`でHTMLコンテンツをパースしたオブジェクト | ||
3. requestモジュールの`response`オブジェクト | ||
@@ -71,2 +71,6 @@ GET時にパラメータを付加する場合は、`get-param`に連想配列で指定します。 | ||
### 0.1.3 (2013-09-09) | ||
* エラーオブジェクトに呼び出し時にセットした`param`を追加 | ||
### 0.1.2 (2013-09-06) | ||
@@ -73,0 +77,0 @@ |
@@ -5,3 +5,3 @@ var vows = require('vows'); | ||
vows.describe('basic test') | ||
vows.describe('encoding test') | ||
.addBatch({ | ||
@@ -8,0 +8,0 @@ 'encoding: x-sjis(not supported)': { |
@@ -10,3 +10,3 @@ var vows = require('vows'); | ||
var _this = this; | ||
cli.fetch('http://www.google.com/not-existing-page.html', function (err, $) { | ||
cli.fetch('http://www.google.com/not-existing-page.html', { hoge: 'fuga' }, function (err, $) { | ||
_this.callback(undefined, { | ||
@@ -27,2 +27,5 @@ error: err, | ||
}, | ||
'error param: { hoge: "fuga" }': function (topic) { | ||
assert.deepEqual(topic.error.param, { hoge: 'fuga' }); | ||
}, | ||
'error content is defined': function (topic) { | ||
@@ -35,3 +38,3 @@ assert.equal(topic.$('title').text(), 'Error 404 (Not Found)!!1'); | ||
var _this = this; | ||
cli.fetch('http://not-existing-host/', function (err, $) { | ||
cli.fetch('http://not-existing-host/', { hoge: 'fuga' }, function (err, $) { | ||
_this.callback(undefined, { | ||
@@ -49,2 +52,5 @@ error: err, | ||
}, | ||
'error param: { hoge: "fuga" }': function (topic) { | ||
assert.deepEqual(topic.error.param, { hoge: 'fuga' }); | ||
}, | ||
'error content is not defined': function (topic) { | ||
@@ -51,0 +57,0 @@ assert.isUndefined(topic.$); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15896
353
94
0