mercredi 28 juillet 2021

Alternative way for asform() in laravel for authentication?

To call http post request for generating access token in laravel.

$test= Http::withHeaders($headers)->post($url,$parameters);

It throws error like

Unsupported grant type ,grant type is null

When I tried this

$test= Http::withHeaders($headers)->asForm()->post($url,$parameters);

It works fine. But I need to do it with the first code because I used this code every where for API call.so that I can optimize the program.



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

Aucun commentaire:

Enregistrer un commentaire