Comparing version 0.2.4 to 0.2.5
var req = require('../'); | ||
req('http://newcar.xcar.com.cn/nanning/201411/market_4660879.html', function(err, resp){ | ||
if(err){ | ||
req({ | ||
uri : 'http://192.168.100.135:9200/taobao-201412/product/_search', | ||
method: 'POST', | ||
timeout: 1000, | ||
data: { | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{ | ||
"term": { | ||
"item_id": "36634548964" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, function(err, resp){ | ||
if (err) { | ||
return console.log('[ERROR]', err.message); | ||
@@ -5,0 +22,0 @@ } |
@@ -154,3 +154,5 @@ // Copyright 2014 Tjatse | ||
if(typeof this.options.timeout == 'number'){ | ||
req.setTimeout(this.options.timeout, req.abort); | ||
req.setTimeout(this.options.timeout, function(){ | ||
(req && !req.finished) && req.abort(); | ||
}); | ||
} | ||
@@ -157,0 +159,0 @@ |
{ | ||
"name": "req-fast", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "This module is designed to be the fast, lightweight way to fetch the web content(HTML stream).", | ||
@@ -5,0 +5,0 @@ "main": "lib/req.js", |
54229
1073