阅读背景:

Node.js - 在HTTP GET请求查询中发送时,数组转换为对象

来源:互联网 

The following Node.js code:

以下Node.js代码:

var request = require('request');

var getLibs = function() {
    var options = { packages: ['example1', 'example2', 'example3'], os: 'linux', pack_type: 'npm' }

    request({url:'https://localhost:3000/package', qs:options}, 
    function (error , response, body) {
        if (! error && response.statusCode == 200) {
            console.log(body);
        } else if (error) {
            console.log(error);
        } else{
            console.log(response.statusCode);
        }
    });
}();
va



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: