示例#1
0
 function Execute()
 {
     $this->SetOption(CURLOPT_URL, $this->BuildUrl());
     if ($this->method->Equals(Http\RequestMethod::Post())) {
         if (count($this->postParams) > 0) {
             $this->SetOption(CURLOPT_POSTFIELDS, $this->postParams);
         } else {
             $this->SetOption(CURLOPT_POSTFIELDS, $this->postData);
         }
     }
     $this->SetHeaders();
     $result = curl_exec($this->ch);
     $errNo = $this->GetErrorNo();
     if ($errNo) {
         throw new \Exception($this->GetError(), $errNo);
     }
     return $result;
 }