Skip to content

Instantly share code, notes, and snippets.

@narutolby
Last active December 21, 2015 01:29
Show Gist options
  • Save narutolby/6228370 to your computer and use it in GitHub Desktop.
Save narutolby/6228370 to your computer and use it in GitHub Desktop.
/*
* 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