コード例 #1
0
ファイル: Client.php プロジェクト: cdcchen/dayu-client
 /**
  * @param BaseRequest $request
  * @return Response
  * @throws \cdcchen\net\curl\RequestException
  */
 public function execute(BaseRequest $request)
 {
     $request->beforeExecute();
     $this->_params = array_merge($this->_params, $request->getParams());
     $this->prepare();
     $response = CUrlClient::post($this->_restUrl, $this->_params)->send();
     return $this->afterExecute($request, $response);
 }
コード例 #2
0
ファイル: UpYunClient.php プロジェクト: cdcchen/upyun-client
 /**
  * @return string
  * @throws \cdcchen\upyun\base\RequestException
  * @throws \cdcchen\upyun\base\ResponseException
  */
 public function getBucketUsage()
 {
     $path = '/?usage';
     $url = $this->buildRequestUrl($path);
     $headers = $this->buildHeaders('GET', $path);
     $request = Client::get($url, null, $headers);
     $response = static::sendRequest($request);
     return static::handleResponse($response, function (HttpResponse $response) {
         return $response->getContent();
     });
 }
コード例 #3
0
ファイル: Client.php プロジェクト: cdcchen/aliyun-client
 /**
  * @param BaseRequest $request
  * @return bool|Response
  * @throws \cdcchen\net\curl\RequestException
  */
 public function execute(BaseRequest $request)
 {
     if (!$this->beforeExecute($request)) {
         return false;
     }
     $request->beforeExecute();
     $this->mergeRequestParams($request);
     $this->prepare();
     $httpRequest = CUrlClient::post($this->getRestUrl(), $this->_params);
     if ($this->_https) {
         $httpRequest->setSSL();
     }
     /* @var HttpResponse $response */
     $response = $httpRequest->send();
     $this->applyFilters($response);
     return $this->afterExecute($response);
 }