How to consume a call center webservice they gave me a url to be consumed by laravel I have the form done and everything else that sends me the parameters by jQuery
class CallController extends Controller
{
public function showCall(Request $request)
{
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', 'http://mi_ip:8080/IntegrationWs/resources/callback/'. $request->input('telefono'));
return response()->json([
'status' => TRUE,
'data' => $res->getBody()
]);
}
}
it returns an errorcURL error 7: Failed to connect to 10.1.3.185 port 8080
I use this class to make my life easier, I have used it in pure PHP and in Laravel, you can test by Postman the service is fine and then pass to the code
To test it you can start in a pure php so you understand it, if you don't use a proxy, change it to false and don't send those parameters, I put them because I must use them. Enter this page and generate a URL that receives your requests https://requestb.in/ it will give you something like https://requestb.in/11tqqii1
If it works for you here, your script is fine and you should check the url you consume,
It will return something like:
Now in laravel you can create a controller with this class that I pass to you, add the route in the web.php (depends on the version I use 5.4 )