I think your syntax is wrong only:
Http::withHeaders(['Authorization' => $zohoToken])->get('https://subscriptions.zoho.com/api/v1/plans');
and the content type by default is sent as the one you need.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to send the Header using HTTP Client in the get() method, let me share my code with you.
Http::withHeaders(['Authorization', $zohoToken])->get('https://subscriptions.zoho.com/api/v1/plans');
I want to pass these headers but don't know how to pass headers in the http::get() request
$header = array(
'Authorization: Zoho-oauthtoken ' . $accessToken,
'Content-Type: application/json' );
I check it for some reason my headers are not, maybe I am doing something wrong How I check that header is not set
var_dump($plans->header('Authorization'));
In postman, the same thing is working. I am attaching the screen shot of postman
'https://drive.google.com/file/d/1_-uVYX4K0WdSUbKW3eIIZl7m68vhI_df/view?usp=sharing'
I think your syntax is wrong only:
Http::withHeaders(['Authorization' => $zohoToken])->get('https://subscriptions.zoho.com/api/v1/plans');
and the content type by default is sent as the one you need.
Please or to participate in this conversation.