Last active
December 21, 2015 01:29
-
-
Save narutolby/6228370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* request.js 为调用入口 | |
* HttpClient.js 为封装类库 | |
* 不支持https | |
* 使用方式: | |
* node request.js <URL> | |
* example: node request.js http://www.baidu.com | |
* 支持简单的添加cookie,没有解析domain,path,expire | |
*/ | |
var HttpClient = require('./HttpClient.js'); | |
var url = process.argv[2]; | |
if(!url){ | |
console.warn("Please input URL!"); | |
return; | |
} | |
HttpClient.request("GET",process.argv[2],function(data){ | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment