var request = require('request');
request.post({url: 'http://api.ximalaya.com/oauth2/secure_access_token', timeout: 3000, form: {client_id:'a06f246cb2b38a656cef4f90c58d94c02',device_id:'myweb',grant_type:'client_credentials',nonce:'7abe3tsfef',timestamp:'1453116822556',sig:'f65baec594ddad225651ead8f09b0d070'}}, function (error, response, data) {
if (!error && response.statusCode == 200) {
console.log(data);
} else {
console.log(data);
}
});
var http=require("http");
var server=http.createServer(function(req,res){
将代码复制进去。
});
server.listen(1122,"localhost",function(){
console.log("开始监听...");
});