Exemplo n.º 1
0
 private function doMethod($s)
 {
     curl_setopt($s, CURLOPT_HTTPHEADER, $this->requestHeaders);
     curl_setopt($s, CURLOPT_HEADER, TRUE);
     curl_setopt($s, CURLOPT_RETURNTRANSFER, TRUE);
     foreach ($this->options as $option => $value) {
         curl_setopt($s, $option, $value);
     }
     $out = curl_exec($s);
     $this->status = curl_getinfo($s, CURLINFO_HTTP_CODE);
     $this->responseHeaders = curl_getinfo($s, CURLINFO_HEADER_OUT);
     curl_close($s);
     list($this->responseHeaders, $content) = HttpUtils::decodeOut($out);
     //         if ($this->status != self::HTTP_OK) {
     //             throw new \Exception("http error: {$this->status}", $this->status);
     //         }
     return $content;
 }