Http Client in Laravel only support port 80?

Viewed 22

I have a request to a python FASTAPI on port 8000 using Laravel's HTTP client which is a wrapper for Guzzle's HTTP client. Anytime I send a request, it fails because it is sent to port 80. I tried several times to add options to the request but it still fails. Using the Guzzle HTTP client everything works fine. I am just wondering why the HTTP client only works for port 80

Below is the code we tried

  $response = Http::withOptions([
                'debug' => true,
                //'proxy' => [
                //    'https'  => 'http://127.0.0.1:8088'
                //    ] // Use this proxy with "HTTP"
               ])->get('http://127.0.0.1:8088/getImage/1/200');
             
     print($response->body());

     return response()->download($response);  

We set the proxy to force it to use the port but failed.

0 Answers
Related