I configured a Node.js server which pulls data from a PostgreSQL database and returns the response in the form of JSON.
The URL is:
http://139.59.232.218:3000/odoo-client?client_req={"opts" : {"login" : "admin","password" : "admin","db" : "cctv_prod_db","host": "139.59.232.218","port": "80"},"moduleDetail" : {"model" : "product.category","method" : "search","args" :[],"filter" : ["sub_category_type","ilike","service"],"fields" : "","domain" : "","offset" : "","limit" : "","sort" : "","resource_id":""}}
While it successfully returns the response when I load it in a web browser, when I try to consume it in PHP no response is returned.
This is my php:
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
echo $data;