49 if ( !$this->status->isOK() ) {
50 return Status::wrap( $this->status );
67 if ( $this->caInfo ) {
71 if ( $this->headersOnly ) {
74 }
elseif ( $this->method ==
'POST' ) {
86 $this->reqHeaders[
'Expect'] =
'';
96 $this->status->fatal(
'http-internal-error' );
97 throw new InvalidArgumentException(
"Error setting curl options." );
102 if ( !
curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION,
true ) ) {
103 $this->logger->debug( __METHOD__ .
": Couldn't set CURLOPT_FOLLOWLOCATION. " .
104 "Probably open_basedir is set.\n" );
111 if ( $this->profiler ) {
112 $profileSection = $this->profiler->scopedProfileIn(
113 __METHOD__ .
'-' . $this->profileName
118 if (
curl_errno( $curlHandle ) == CURLE_OPERATION_TIMEOUTED ) {
119 $this->status->fatal(
'http-timed-out', $this->url );
120 }
elseif ( $curlRes ===
false ) {
121 $this->status->fatal(
'http-curl-error',
curl_error( $curlHandle ) );
123 $this->headerList = explode(
"\r\n", $this->headerText );
128 if ( $this->profiler ) {
129 $this->profiler->scopedProfileOut( $profileSection );
135 return Status::wrap( $this->status );