當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ClientInterface::put方法代碼示例

本文整理匯總了PHP中Guzzle\Http\ClientInterface::put方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClientInterface::put方法的具體用法?PHP ClientInterface::put怎麽用?PHP ClientInterface::put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Guzzle\Http\ClientInterface的用法示例。


在下文中一共展示了ClientInterface::put方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: put

 /**
  * {@inheritdoc}
  */
 public function put($url, array $headers = array(), $content = '')
 {
     $headers['content-type'] = 'application/json';
     $request = $this->client->put($url, $headers, $content);
     $this->response = $request->send();
     return $this->response->getBody(true);
 }
開發者ID:BAY-A,項目名稱:Gravity-Forms-DigitalOcean,代碼行數:10,代碼來源:GuzzleAdapter.php

示例2: put

 /**
  * {@inheritdoc}
  */
 public function put($url, array $headers = array(), array $content = array(), array $files = array())
 {
     $request = $this->client->put($url, $headers, $content);
     foreach ($files as $key => $file) {
         $request->addPostFile($key, $file);
     }
     return $this->sendRequest($request);
 }
開發者ID:widop,項目名稱:http-adapter,代碼行數:11,代碼來源:GuzzleHttpAdapter.php

示例3: put

 /**
  * {@inheritdoc}
  */
 public function put($url, $content = '')
 {
     $request = $this->client->put($url, [], $content);
     try {
         $this->response = $request->send();
     } catch (RequestException $e) {
         $this->response = $e->getResponse();
         $this->handleError();
     }
     return $this->response->getBody(true);
 }
開發者ID:skaisser,項目名稱:organizze,代碼行數:14,代碼來源:GuzzleAdapter.php

示例4: put

 /**
  * {@inheritdoc}
  */
 public function put($url, $content = '')
 {
     $request = $this->client->put($url);
     if (is_array($content)) {
         $request->setBody(json_encode($content), 'application/json');
     } else {
         $request->setBody($content);
     }
     try {
         $this->response = $request->send();
     } catch (RequestException $e) {
         $this->response = $e->getResponse();
         $this->handleError();
     }
     return $this->response->getBody(true);
 }
開發者ID:skaisser,項目名稱:upcloud,代碼行數:19,代碼來源:GuzzleAdapter.php

示例5: put

 /**
  * {@inheritDoc}
  */
 public function put($path, $body = null, array $parameters = array(), array $headers = array())
 {
     $parameters = $this->buildQueryParameters($parameters);
     return $this->request($this->client->put($path, $headers, $body, $parameters));
 }
開發者ID:n10ty,項目名稱:api,代碼行數:8,代碼來源:HttpClient.php

示例6:

 function it_format_the_request_to_a_valid_form_urlencode(ClientInterface $client, RequestInterface $request)
 {
     $client->put('/resource', ['Content-Type' => 'application/x-www-form-urlencoded'], 'foo=bar&baz=plop', ['some options'])->shouldBeCalled(1)->willReturn($request);
     $this->setClient($client);
     $this->build('/resource', null, null, null, ['foo' => 'bar', 'baz' => 'plop'], ['some options'])->shouldReturn($request);
 }
開發者ID:puterakahfi,項目名稱:FriendlyContexts,代碼行數:6,代碼來源:PutRequestBuilderSpec.php

示例7: log

 /**
  * Update the LaunchKey Engine with the current status of the auth request or user session
  *
  * @param string $authRequest auth_request returned from an auth call
  * @param string $action Action to log.  i.e. Authenticate, Revoke, etc.
  * @param bool $status
  * @return null
  * @throws CommunicationError If there was an error communicating with the endpoint
  * @throws InvalidCredentialsError If the credentials supplied to the endpoint were invalid
  * @throws InvalidRequestError If the endpoint proclaims the request invalid
  * @throws ExpiredAuthRequestError If the auth request has expired
  * @throws LaunchKeyEngineError If the LaunchKey cannot apply the request auth request, action, status
  */
 public function log($authRequest, $action, $status)
 {
     $encryptedSecretKey = $this->getEncryptedSecretKey();
     $request = $this->guzzleClient->put("/v1/logs")->addPostFields(array("app_key" => $this->appKey, "secret_key" => base64_encode($encryptedSecretKey), "signature" => $this->cryptService->sign($encryptedSecretKey), "auth_request" => $authRequest, "action" => $action, "status" => $status ? "True" : "False"));
     $this->sendRequest($request);
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-php,代碼行數:19,代碼來源:GuzzleApiService.php


注:本文中的Guzzle\Http\ClientInterface::put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。