Hey im currently trying to get some info from a local wallet via curl in php.
Which works.
But the response form the client takes often longer than a minute.
Am i doing something wrong or does the wallet always take so long to answer while syncing?
here the php code
$data_string = '{"method": "get_info", "params": [], "id": "0"}';
$username = 'test';
$password = 'test';
$ch = curl_init('http://127.0.0.1:19988/rpc');
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
print_r ($result);