I am getting error Expecting value: line 1 column 1 (char 0) when trying to decode JSON.
The URL I use for the API call works fine in the browser, but gives this error when done through a curl request. The following is …
So I have a link that returns a jSON object, and I need to have it decoded and put into variables in PHP.
URL
api.php?action=getThreads&hash=123fajwersa&node_id=4&order_by=post_date&…
Here is my model with a json response:
exports.getUser = function(req, res, callback) {
User.find(req.body, function (err, data) {
if (err) {
res.json(err.errors);
} else {
res.json(data);
}
});
};
Here I get it via http.request. Why do …