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


PHP Browser::put方法代碼示例

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


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

示例1: setRecord

 /**
  * This will update all fields of a table record, issuing a PUT request to the record endpoint. Any fields that are not included will be cleared ().
  *
  * @param string $table
  * @param array  $criteria
  * @param array  $fields
  */
 public function setRecord($table, array $criteria = [], array $fields)
 {
     $record = $this->findRecord($table, $criteria);
     /** @var Response $response */
     $response = $this->browser->put($this->getEndpoint($table, $record->getId()), ["content-type" => "application/json"], json_encode(["fields" => $fields]));
     $this->guardResponse($table, $response);
 }
開發者ID:armetiz,項目名稱:airtable-php,代碼行數:14,代碼來源:Airtable.php

示例2: put

 /**
  * {@inheritdoc}
  */
 public function put($url, array $headers = array(), $content = '')
 {
     $response = $this->browser->put($url, $headers, $content);
     if (!$response->isSuccessful()) {
         throw $this->handleResponse($response);
     }
     return $response->getContent();
 }
開發者ID:fideloper,項目名稱:DigitalOceanV2,代碼行數:11,代碼來源:BuzzAdapter.php

示例3: put

 /**
  * {@inheritdoc}
  */
 public function put($url, $content = '')
 {
     $headers = [];
     if (is_array($content)) {
         $content = json_encode($content);
         $headers[] = 'Content-Type: application/json';
     }
     $response = $this->browser->put($url, $headers, $content);
     $this->handleResponse($response);
     return $response->getContent();
 }
開發者ID:robertol,項目名稱:DigitalOceanV2,代碼行數:14,代碼來源:BuzzAdapter.php

示例4: put

 /**
  * Common put request for all API calls
  *
  * @param string $resource The path to the resource wanted. For example v2/room
  * @param array $content Parameters be putted for example:
  *                              array(
  *                                'name'                => 'Example name',
  *                                'privacy'             => 'private',
  *                                'is_archived'         => 'false',
  *                                'is_guest_accessible' => 'false',
  *                                'topic'               => 'New topic',
  *                              )
  *
  * @return array Decoded array containing response
  * @throws Exception\RequestException
  */
 public function put($resource, $content = array())
 {
     $url = $this->baseUrl . $resource;
     $headers = array('Content-Type' => 'application/json', 'Authorization' => $this->auth->getCredential());
     $response = $this->browser->put($url, $headers, json_encode($content));
     if ($this->browser->getLastResponse()->getStatusCode() > 299) {
         throw new RequestException(json_decode($this->browser->getLastResponse()->getContent(), true));
     }
     return json_decode($response->getContent(), true);
 }
開發者ID:Andrewpk,項目名稱:jenkinsFailReminder,代碼行數:26,代碼來源:Client.php

示例5: put

 /**
  * {@inheritdoc}
  */
 public function put($url, $content = '')
 {
     $response = $this->browser->put($url, [], $content);
     $this->handleResponse($response);
     return $response->getContent();
 }
開發者ID:softr,項目名稱:asaas-php-sdk,代碼行數:9,代碼來源:BuzzAdapter.php

示例6: send

 /**
  * @param string $uri
  * @param string $data
  * @return bool
  */
 public function send($uri, $data)
 {
     $response = $this->browser->put($uri, [], $data);
     $statusCode = $response->getStatusCode();
     return $statusCode >= 200 && $statusCode < 300;
 }
開發者ID:publero,項目名稱:api-notification-bundle,代碼行數:11,代碼來源:BuzzClient.php


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