Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the response headers #152

Open
dskanth opened this issue Jul 7, 2015 · 1 comment
Open

Get the response headers #152

dskanth opened this issue Jul 7, 2015 · 1 comment

Comments

@dskanth
Copy link

dskanth commented Jul 7, 2015

Hi, i would like to know how to view the response headers for a request.
For example, i make a request like below:

request( $endpoint, 'GET', '', array() ), true); ?>

Now sometimes i get the result as blank (esp. for POST requests), but the response would still be containing some headers. How can i read those header values? Can someone please help me?

@dskanth
Copy link
Author

dskanth commented Jul 9, 2015

Well, i identified the request method for the Oauth call, and it contains some code like below:

$response = file_get_contents($endpoint->getAbsoluteUri(), false, $context);

So immediately after that line, i added the below line, to fetch the response headers:
$res_headers = $http_response_header;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant