mardi 20 novembre 2018

Not working on Laravel Controller, Working on Tinker

Guzzle version(s) affected: 6.3 Laravel: 5.6.3 PHP: 7.2.10

Description If I am trying to get response in tinker

$client = new \GuzzleHttp\Client();
$response = $client->get($url);
json_decode($response->getBody())

I am getting response as expected.

but in my controller

$object_res = $client->get($url);

I am getting error

"cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)",…}

Which means, the url is incorrect, but as I have described, this working perfectly in tinker.

Note I am getting everything working perfectly in my localhost, this is occurring only on my test server.

Please let me know, if I need to give additional information.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire