ranm8 / requestify

Simplifies node HTTP request making.
http://ranm8.github.io/requestify
MIT License
223 stars 55 forks source link

got the response and then got exception "unexpected token u" how to handle it? #40

Closed vasuvanka closed 8 years ago

vasuvanka commented 8 years ago

Hi ranm8,

when am making a rest call using below code am getting res as am expected and then am getting exception as unexpected token u . how to handle the case.

requestify.request("www.api.com", { method: "POST", body: data, dataType: 'json' }).then(function (res) { res.getBody(); res.getHeaders(); res.getCode(); callback(null, res.body); }).catch(function (err) { callback(err); });

waiting for ack asap..thank u

vasuvanka commented 8 years ago

issue resolved..solution is i was multiple times parsing data so that i got above mentioned issue.