I have created my appium automation framework using javascript + mocha so I use supertest.js (for http calls) with should.js (for assertions) to handle api calls.
A sample POST request looks like:
request
.post('/api/pet')
.send({ name: 'Manny', species: 'cat' })
.set('X-API-Key', 'foobar')
.set('Accept', 'application/json')
.end(function(err, res){
if (err || !res.ok) {
console.log('Oh no! error');
} else {
console.log(res.body)
//You can add assertions like
res.body.data.should.be.an.Object();
res.body.data.name.should.be.a.String();
}
});