This happened on GuzzleHttp
Below code give me that error
1 2 3 4 5 6 7 8 9 | $url = "https://somedomain.test/api/create"; $client = new Client(); $headers = ["key" => "somekey"]; $params = ["first_name"=> "Rido", "last_name" => "Ilahi"]; $response = $client->post($url, [ 'headers' => $headers, 'form_params' => $params ]); |
The quick solve is to reformat above code to below
1 2 3 4 5 6 7 8 9 10 11 12 13 | $baseUri = "https://somedomain.test"; $path = "api/create"; $client = new Client([ 'base_uri' => $baseUri ]); $headers = ["key" => "somekey"]; $params = ["first_name"=> "Rido", "last_name" => "Ilahi"]; $response = $client->post($path, [ 'headers' => $headers, 'form_params' => $params ]); |