当前位置: 首页>>代码示例>>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;未经允许,请勿转载。