I trying to calling an Api with Authorization header. After dispatch the request, the authorization header does not exist.
Note:
1. Through Postman everything work fine.
2. (The issue is) Authorizarion header missing after request dispatch via my application.
Please have a look at my code below.
Authorization Header Exist with API Calling..
$request = ApiReq::create('/api/'.$endPoint, $method);
$request->headers->set('Authorization','Bearer '.session()->get('auth_token'));
//Authorization header exist in such request
dd($request->header());
}
Authorization header missing at Api Endpoint in such request
Route::match(['get', 'post'], 'profile/{uid?}', function(Request $request){
//Authorization header not exist in such request
dd($request->header());
});
Do you have any idea to resolve the issue??