My problem is the following, I send data with guzzle, and got error
TypeError: res.json is not a function.
$client = new \GuzzleHttp\Client();
$response = $client->request('get', 'http://localhost/data', ['total' => ['total' => 15]);
I tried the following 2 ways, but they don't seem to work.
exports.data= function(res,req){
return res.json({ result: 'success' });
};
exports.data= function(res,req){
res.json({ result: 'success' });
};
Node is working on port 3000.
Error code: TypeError: res.json is not a function Or php page Type: GuzzleHttp\Exception\ServerException
Message: Server error: GET http://localhost:3000/data resulted in a 500 Internal Server Error response: TypeError: res.j (truncated...)