lundi 12 décembre 2022

Argument 1 passed to Symfony\Component\HttpFoundation\Request::__construct()

I have this error that says:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::__construct() must be of the type array, string given, called in C:\xampp\htdocs\satusehat2\app\Http\Controllers\PasienController.php on line 68.

This is my function

public function curl_postman() {
        $client = new Client();
        $headers = [
          'Content-Type' => 'application/json',
          'Authorization' => 'My Bearer token'
        ];
        $body = '';
        $request = new Request('GET', 'my-api-address', $headers, $body);
        $res = $client->sendAsync($request)->wait();
        echo $res->getBody();
        
    }

and the line 68 is

$body = '';


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/REYspOd
via IFTTT

Aucun commentaire:

Enregistrer un commentaire