I want to send Header using Http Client in get() method, let me share my code with you.
Http::get('https://subscriptions.zoho.com/api/v1/plans')->withHeader(['Authorization', $zohoToken]);
I want to pass these headers but don't know how to pass headers in http::get() request
$header = array(
'Authorization: Zoho-oauthtoken ' . $accessToken,
'Content-Type: application/json' );
CodePudding user response:
Use here withHeaders method
Http::withHeaders([
'Authorization' => 'Zoho-oauthtoken ' . $accessToken,
'Content-Type' => 'application/json'
])->get('https://subscriptions.zoho.com/api/v1/plans');