keep_alive = false; $http->headers = array_merge($http->headers, $extraHeaders); $ok = $http->sendRequest($endpoint->getAbsoluteUri(), $requestBody, $method); if (!$ok || $http->status < 200 || $http->status > 299) { $msg = "An error occured during the request to the oauth provider:\n"; throw new HttpTokenResponseException( $msg . $http->error . ' [HTTP ' . $http->status . ']', $http->status, $http->error, $http->resp_body ); } return $http->resp_body; } }