首页 > Web开发 > 详细

node.js [superAgent] 请求

时间:2015-03-11 17:32:56      阅读:352      评论:0      收藏:0      [点我收藏+]
post请求: 
 request.post(‘/api/pet‘)
   .end(function(resp,err){
     if (resp.body.status===200) {
       alert(‘yay got ‘ + JSON.stringify(res.body));
     } else {
       return next(resp.body);
     }
   });
get请求: 
 request.get(‘/api/pet‘)
     ...
   });
delete请求: 
 request.del(‘/api/pet‘)
     ...
   });
put请求: 
 request.put(‘/api/pet‘)
     ...
   });


node.js [superAgent] 请求

原文:http://my.oschina.net/u/1778309/blog/385429

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!