Example #1
0
 /**
  * @method parseResponse  Parses response from request.
  * @param string parseResponse
  * @return HttpRequest_Response_Html
  */
 protected function parseResponse($response)
 {
     return HttpRequest_Response_Html::factory()->setBody($response);
 }
Example #2
0
 /**
  * @method parseResponse  Parses response from request.
  * @param string parseResponse
  * @return HttpRequest_Response_Html
  */
 protected function parseResponse($response)
 {
     if ($response) {
         $curl_info = curl_getinfo($this->handle);
         if (isset($curl_info['header_size'])) {
             $header_size = $curl_info['header_size'];
             $header = substr($response, 0, $header_size);
             $response = substr($response, $header_size);
         } else {
             $header = null;
         }
         $response = HttpRequest_Response_Html::factory()->parseResponse($response, $header);
     } else {
         $this->error = curl_errno($this->handle) . ' - ' . curl_error($this->handle);
     }
     return $response;
 }