Javascript Object Response

Viewed 9446

I am calling a RESTful web service using the http-https node package. Code below:

var request = http.get(url, function(resp){
   console.log(resp);       
});
request.end();

However, when I examine what is held in the variable resp, it comes back as [Object]. When I ask for resp.toString(), I get `[object Object]'. I know that the service is returning me JSON, and I know the structure of the JSON. However, I am unsure why I am getting this response back instead of JSON.

1 Answers
Related