Open dskanth opened 9 years ago
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;
Hi, i would like to know how to view the response headers for a request. For example, i make a request like below:
<?php $serviceFactory = new \OAuth\ServiceFactory(); $tw = OAuth::consumer( 'Twitter' );
$endpoint = '/users/xxx'; $result = json_decode($tw->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?