Error “Malformed UTF-8 characters” header bearer

Hello, I have problem when authorization my API.
Error “Malformed UTF-8 characters” ;
I want to receive my API from header(Bearer) but I get this error!!


*:

Hi @Dude

Not much info to go off here…

What API are you hitting?
Is it one you made? or a public one that has documentation available?

If you made the API, are you encoding your sting in PHP? Are you sure it encodes correctly?
Some of the info here may help;

If it’s a public/3rd party API, do you have a link to the documentation?

Also, have you checked you are setting the correct headers etc?

If the problem persists, can you add some more info? console log screenshots and maybe one of your request/response headers?

my problem solved by this code.

    $allheaders=getallheaders();

$bearer= $allheaders["Authorization"];
$jwt=trim(str_replace('Bearer','',$bearer));

So the header was missing the ‘Bearer’ prefix?
(if I have read that correctly…)

Glad you sorted it!

Thanks for your help. :+1: :+1: