mardi 27 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.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire