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


PHP OperationCommand::build方法代碼示例

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


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

示例1: build

 /**
  * {@inheritdoc}
  */
 protected function build()
 {
     parent::build();
     // json responses have the "text/javascript; charset=UTF-8" content type ...
     if ('json' === $this->get('format')) {
         $this->set('command.expects', 'application/json');
     }
 }
開發者ID:adrienbrault,項目名稱:itunes-client,代碼行數:11,代碼來源:FeedCommand.php

示例2: build

 public function build()
 {
     parent::build();
     $client = $this->getClient();
     $username = $client->getUsername();
     $password = $client->getPassword();
     $this->request = $this->getRequestSerializer()->prepare($this);
     $this->request->addPostFields(array('user' => $username, 'pass' => $password));
 }
開發者ID:matmar10,項目名稱:campbx,代碼行數:9,代碼來源:AuthenticatedCommand.php

示例3: build

 /**
  * Create the request object that will carry out the command
  */
 protected function build()
 {
     parent::build();
     // This request needs the master secret
     $user = $this->getClient()->getConfig()->get('appKey');
     $pass = $this->getClient()->getConfig()->get('appMasterSecret');
     $this->request->setAuth($user, $pass);
     if (!$this->request->hasHeader('Content-Type')) {
         $this->request->setHeader('Content-Type', $this->jsonContentType);
     }
     $payload = $this->assemblePayload();
     $this->request->setBody(json_encode($payload));
 }
開發者ID:phindmarsh,項目名稱:blimp,代碼行數:16,代碼來源:PushCommand.php

示例4: build

 /**
  * {@inheritdoc}
  */
 protected function build()
 {
     parent::build();
     // Ensure that the body of the request ALWAYS includes some JSON. By default, this is an empty object.
     if (!$this->request->getBody()) {
         $this->request->setBody('{}');
     }
     // Never send the Expect header when interacting with a JSON query service
     $this->request->removeHeader('Expect');
     // Always send JSON requests as a raw string rather than using streams to avoid issues with
     // cURL error code 65: "necessary data rewind wasn't possible".
     // This could be removed after PHP addresses https://bugs.php.net/bug.php?id=47204
     $this->request->getCurlOptions()->set(CurlHandle::BODY_AS_STRING, true);
 }
開發者ID:eSDK,項目名稱:esdk_obs_native_php,代碼行數:17,代碼來源:JsonCommand.php

示例5: build

 /**
  * {@inheritdoc}
  */
 protected function build()
 {
     // By default, JSON commands with AWS require no response model processing
     if ($this->operation->getResponseType() == OperationInterface::TYPE_MODEL && $this->get(self::RESPONSE_PROCESSING) == self::TYPE_MODEL) {
         $this->responseParser = $this->get('command.model_processing') ? OperationResponseParser::getInstance() : NoTranslationOperationResponseParser::getInstance();
     } else {
         $this->responseParser = DefaultResponseParser::getInstance();
     }
     parent::build();
     // Ensure that the body of the request ALWAYS includes some JSON. By default, this is an empty object.
     if (!$this->request->getBody()) {
         $this->request->setBody('{}');
     }
     // Never send the Expect header when interacting with a JSON query service
     $this->request->removeHeader('Expect');
 }
開發者ID:romainneutron,項目名稱:aws-sdk-php,代碼行數:19,代碼來源:JsonCommand.php

示例6: build

 /**
  * {@inheritdoc}
  */
 protected function build()
 {
     parent::build();
     $this->request->getQuery()->set('token', $this->getClient()->getConfig('token'));
 }
開發者ID:porot,項目名稱:api-client,代碼行數:8,代碼來源:AbstractCommand.php


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