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') ... });