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

تعليقات

المشاركات الشائعة من هذه المدونة

How to Create Treeview with Bootstrap and jQuery

jQuery Datatables with PHP, MySQL and AJAX Example

How to Add Images to Dropdown List using jQuery