# Follow Authorization header - Question

**URL:** <https://community.postman.com/t/follow-authorization-header-question/13024>\
**Category:** Help Hub\
**Tags:** collections, authentication\
**Created:** [June 1, 2020, 12:57pm UTC](https://community.postman.com/t/follow-authorization-header-question/13024 "2020-06-01T12:57:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![team.attractive0](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@team.attractive0](https://community.postman.com/u/team.attractive0)\
**Post date:** [June 1, 2020, 12:57pm UTC](https://community.postman.com/t/follow-authorization-header-question/13024/1 "2020-06-01T12:57:02Z")

</div>

Hi Team,

I’m happy if you help me here. I’m just trying to get code in PHP(curl). But the issue is how to " **Retain authorization header when a redirect happens to a different hostname.**" But no changes are done when I’m coping PHP code of my request. How to code that in the PHP curl file.

_\<?php_

 

$curl = curl\_init();

curl\_setopt\_array($curl, array(  
CURLOPT\_URL =\> “[https://resmed-agm--sit.cs37.my.salesforce.com/services/apexrest/api/hubspot/v1/HubspotAPI\_SleepQuiz](https://resmed-agm--sit.cs37.my.salesforce.com/services/apexrest/api/hubspot/v1/HubspotAPI_SleepQuiz)”,  
CURLOPT\_RETURNTRANSFER =\> true,  
CURLOPT\_ENCODING =\> “”,  
CURLOPT\_MAXREDIRS =\> 10,  
CURLOPT\_TIMEOUT =\> 0,  
CURLOPT\_FOLLOWLOCATION =\> true,  
CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_1\_1,  
CURLOPT\_CUSTOMREQUEST =\> “POST”,  
CURLOPT\_POSTFIELDS =\>"{\n “email”: “[testsalesapi@gmail.com](mailto:testsalesapi@gmail.com)”,\n “name”: “Shivasagar”,\n “phone”: “8861760420”}",  
CURLOPT\_HTTPHEADER =\> array(  
“Authorization: OAuth access\_token”,  
“Content-Type: application/json”,  
“Cookie: BrowserId=KnNiRKC5EeqFJ0UJd0AmeQ”  
),  
));

$response = curl\_exec($curl);

_curl\_close($curl);  
echo $response;_
