I have an API created for export records in xlsx. It is working fine when I call the API directly but if I am using Guzzle/Http to call the API and this was tested using Postman, I get the following error:
"message": "Malformed UTF-8 characters, possibly incorrectly encoded",
"exception": "InvalidArgumentException",
"file": "C:\\xampp\\htdocs\\borneoshop-admin-laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\JsonResponse.php",
"line": 75, ......
Is there any additional configuration I will have to set? Please help. Thanks.
Edit
I have 2 laravel API projects, for example, A and B. The excel export API (/a/export) has to be called in another laravel API (/b/download) with Guzzle/Http. Using Postman, I was testing both APIs and the "/a/export" API was working fine but if I called "/b/download" which I am using Guzzle/Http here with codes,
$client = new \GuzzleHttp\Client();
$res = $client->post($url, ['form_params' => $parameter]);
$content = $res->getBody()->getContents();
return $content;
I am getting the error response as shown above.