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


PHP Http::prepare方法代碼示例

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


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

示例1: activate

 public function activate(array $params) {
     $endPoint = Http::prepare('/mail/activate.json');
     $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'GET'));
     if (!is_object($response)) {
         throw new ResponseException(__METHOD__);
     }
     return $response;
 }
開發者ID:jinguanio,項目名稱:RClubAPI_NEW,代碼行數:8,代碼來源:FreeEmailService.php

示例2: getDnsRecords

    public function getDnsRecords(array $params) {

        $endPoint = Http::prepare('domainforward/dns-records.json');
        $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'GET'));
        if (!is_object($response)) {
            throw new ResponseException(__METHOD__);
        }
        return $response;
    }
開發者ID:jinguanio,項目名稱:RClubAPI_NEW,代碼行數:9,代碼來源:DomainForwardingService.php

示例3: delete

 /**
  * Unregister the mobile devices that are receiving push notifications
  *
  * @param array $devices
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return bool
  */
 public function delete(array $devices = array())
 {
     $endPoint = Http::prepare('push_notification_devices/destroy_many.json');
     $response = Http::send($this->client, $endPoint, array("push_notification_devices" => $devices), 'POST');
     if ($this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return true;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:21,代碼來源:PushNotificationDevices.php

示例4: update

 /**
  * Update one or more settings
  *
  * @param array $params
  *
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function update(array $params)
 {
     $endPoint = Http::prepare('account/settings.json');
     $response = Http::send($this->client, $endPoint, array(self::OBJ_NAME => $params), 'PUT');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:jorgevrgs,項目名稱:zendesk_api_client_php,代碼行數:20,代碼來源:Settings.php

示例5: findAll

 /**
  * Returns a list of sharing agreements
  *
  * @param array $params
  *
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function findAll(array $params = array())
 {
     $endPoint = Http::prepare('sharing_agreements.json', null, $params);
     $response = Http::send($this->client, $endPoint);
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:20,代碼來源:SharingAgreements.php

示例6: importMany

 /**
  * Create multiple new tickets
  *
  * @param array $params
  *
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function importMany(array $params)
 {
     $endPoint = Http::prepare('imports/tickets/create_many.json');
     $response = Http::send($this->client, $endPoint, array(self::OBJ_NAME_PLURAL => $params), 'POST');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:paperray,項目名稱:zendeskapi,代碼行數:20,代碼來源:TicketImport.php

示例7: create

 /**
  * Create a voice or voicemail ticket
  *
  * @param array $params
  *
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function create(array $params)
 {
     $endPoint = Http::prepare('channels/voice/tickets.json');
     $response = Http::send($this->client, $endPoint, $params, 'POST');
     // note: specify the whole package
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 201) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:21,代碼來源:VoiceTickets.php

示例8: anonymousSearch

 /**
  * Perform an anonymous search
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function anonymousSearch(array $params)
 {
     if (!$this->hasKeys($params, array('query'))) {
         throw new MissingParametersException(__METHOD__, array('query'));
     }
     $endPoint = Http::prepare('portal/search.json', null, $params);
     $response = Http::send($this->client, $endPoint, $params, 'GET');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:24,代碼來源:Search.php

示例9: detectBest

 /**
  * Detect the best locale from the supplied list
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function detectBest(array $params)
 {
     if (!$this->hasKeys($params, array('available_locales'))) {
         throw new MissingParametersException(__METHOD__, array('available_locales'));
     }
     $endPoint = Http::prepare('locales/detect_best_locale.json', null, $params);
     $response = Http::send($this->client, $endPoint, array('available_locales' => $params['available_locales']), 'GET');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:jorgevrgs,項目名稱:zendesk_api_client_php,代碼行數:24,代碼來源:Locales.php

示例10: tags

 /**
  * Submits a request for matching tags
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  * @return mixed
  */
 public function tags(array $params)
 {
     if (!$this->hasKeys($params, array('name'))) {
         throw new MissingParametersException(__METHOD__, array('name'));
     }
     $endPoint = Http::prepare('autocomplete/tags.json');
     $response = Http::send($this->client, $endPoint, array(self::OBJ_NAME => $params['name']), 'POST');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:23,代碼來源:Autocomplete.php

示例11: openTicket

 /**
  * Opens a ticket in an agent's browser
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return bool
  */
 public function openTicket(array $params = array())
 {
     if (!$this->hasKeys($params, array('agent_id', 'ticket_id'))) {
         throw new MissingParametersException(__METHOD__, array('agent_id', 'ticket_id'));
     }
     $endPoint = Http::prepare('channels/voice/agents/' . $params['agent_id'] . '/tickets/' . $params['ticket_id'] . '/display.json');
     $response = Http::send($this->client, $endPoint, null, 'POST');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return true;
 }
開發者ID:jorgevrgs,項目名稱:zendesk_api_client_php,代碼行數:24,代碼來源:VoiceAgents.php

示例12: findAll

 /**
  * List all stats
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function findAll(array $params = array())
 {
     if (!$this->hasAnyKey($params, array('current_queue_activity', 'historical_queue_activity', 'agents_activity'))) {
         throw new MissingParametersException(__METHOD__, array('current_queue_activity', 'historical_queue_activity', 'agents_activity'));
     }
     $endPoint = Http::prepare(isset($params['current_queue_activity']) ? 'channels/voice/stats/current_queue_activity.json' : (isset($params['historical_queue_activity']) ? 'channels/voice/stats/historical_queue_activity.json' : (isset($params['agents_activity']) ? 'channels/voice/stats/agents_activity.json' : '')), null, $params);
     $response = Http::send($this->client, $endPoint);
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:jorgevrgs,項目名稱:zendesk_api_client_php,代碼行數:24,代碼來源:VoiceStats.php

示例13: find

 /**
  * Find a specific article by id
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function find(array $params = array())
 {
     if (!$this->hasKeys($params, array('id'))) {
         throw new MissingParametersException(__METHOD__, array('id'));
     }
     $url = sprintf('help_center/%sarticles/%d.json', isset($params['locale']) ? $params['locale'] . '/' : '', $params['id']);
     $endPoint = Http::prepare($url, $this->client->getSideload($params));
     $response = Http::send($this->client, $endPoint);
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__);
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:25,代碼來源:Articles.php

示例14: create

 /**
  * Create a new satisfaction rating (authorised end user credentials only please!)
  *
  * @param array $params
  *
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function create(array $params)
 {
     if ($this->client->tickets()->getLastId() != null) {
         $params['ticket_id'] = $this->client->tickets()->getLastId();
         $this->client->tickets()->setLastId(null);
     }
     $endPoint = Http::prepare('tickets/' . $params['ticket_id'] . '/satisfaction_rating.json');
     $response = Http::send($this->client, $endPoint, array(self::OBJ_NAME => $params), 'POST');
     if (!is_object($response) || $this->client->getDebug()->lastResponseCode != 200) {
         throw new ResponseException(__METHOD__, $this->client->getDebug()->lastResponseCode == 403 ? ' (hint: you need to authenticate as a verified end user for this method)' : '');
     }
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:24,代碼來源:SatisfactionRatings.php

示例15: find

 /**
  * Show a specific audit log
  *
  * @param array $params
  *
  * @throws MissingParametersException
  * @throws ResponseException
  * @throws \Exception
  *
  * @return mixed
  */
 public function find(array $params = array())
 {
     if ($this->lastId != null) {
         $params['id'] = $this->lastId;
         $this->lastId = null;
     }
     if (!$this->hasKeys($params, array('id'))) {
         throw new MissingParametersException(__METHOD__, array('id'));
     }
     $endPoint = Http::prepare('audit_logs/' . $params['id'] . '.json');
     $response = Http::send($this->client, $endPoint);
     $this->client->setSideload(null);
     return $response;
 }
開發者ID:heitorglockner,項目名稱:zendesk_api_client_php,代碼行數:25,代碼來源:AuditLogs.php


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