I'm trying to make a Curl request to an EndPoint. This request has a param which a string text. The function at the Endpoint only return the same string. The issue is that the Endpoint's function only return the first word of the String.
Here is the code I use:
$params = $_SESSION['search'].'/'.$_SESSION['page'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => 'Stlfinder',
CURLOPT_POST => false,
CURLOPT_URL => "mydomain.com/api/search/$params"
));
$resultados = curl_exec($curl);
curl_close($curl);
$resultados = json_decode($resultados);
print_r($resultados);
This is what I get:
stdClass Object ( [result] => The )
and the String sent is: 'The mansion book'
Is there anything missing in the Curl?
$params?