Node.js Request请求
作者:
pokeey | 来源:发表于
2018-07-16 17:26 被阅读0次"use strict";
const http = require('http');
var options = {
protocol:'http:',
hostname:'api.douban.com',
port:'80',
method:'GET',
path:'/v2/movie/top250'
};
var request = http.request(options,(response) => {
console.log(response.statusCode);
// console.log('ok');
console.log(response.headers);
});
request.on('error',(error) => {
console.log(error);
});
request.end();
本文标题:Node.js Request请求
本文链接:https://www.haomeiwen.com/subject/wrwbpftx.html
网友评论