当前位置: 首页>>代码示例>>PHP>>正文


PHP Response::getContent方法代码示例

本文整理汇总了PHP中Zend\Http\Response::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::getContent方法的具体用法?PHP Response::getContent怎么用?PHP Response::getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Http\Response的用法示例。


在下文中一共展示了Response::getContent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assertResponseNotInjected

 protected function assertResponseNotInjected()
 {
     $content = $this->response->getContent();
     $headers = $this->response->getHeaders();
     $this->assertEmpty($content);
     $this->assertFalse($headers->has('content-type'));
 }
开发者ID:wizzvet,项目名称:ZffHtml2pdf,代码行数:7,代码来源:Html2PdfStrategyTest.php

示例2: generate

 /**
  * Returns an ETag for the given response.
  *
  * @param HttpRequest $request
  * @param HttpResponse $response
  * @return string Etag
  */
 public function generate(HttpRequest $request, HttpResponse $response)
 {
     return md5($response->getContent());
 }
开发者ID:adri,项目名称:zf-http-cache,代码行数:11,代码来源:DefaultETagGenerator.php

示例3: decodeResponse

 /**
  * Decodes response
  * 
  * Response is has JSON structure:
  * {"messages":[
  *    {"to":"null",
  *        "status":{
  *            "groupId":5,
  *            "groupName":"REJECTED",
  *            "id":51,
  *            "name":"MISSING_TO",
  *            "description":"Missing destination.",
  *            "action":"Check to parameter."
  *        }
  *    }
  * ]}
  * 
  * @param Response $response
  * @return void
  */
 private function decodeResponse($response)
 {
     $data = json_decode($response->getContent());
     if (count($data->messages) > 0) {
         foreach ($data->messages as $message) {
             $this->parseResponseMessage($message);
         }
     }
 }
开发者ID:orajo,项目名称:sms-zilla,代码行数:29,代码来源:InfobipAdapter.php

示例4: toHttpFoundationResponse

 /**
  * Transforms a Zend\Http\Response into an HttpFoundation one.
  * 
  * @param ZendResponse $zresponse The Zend\Http\Response
  * 
  * @return HttpFoundationResponse
  */
 public static function toHttpFoundationResponse(ZendResponse $zresponse)
 {
     return HttpFoundationResponse::create($zresponse->getContent(), $zresponse->getStatusCode(), $zresponse->getHeaders()->toArray());
 }
开发者ID:fwk,项目名称:security,代码行数:11,代码来源:RequestBridge.php

示例5: sendResponse

 private function sendResponse(Response $response)
 {
     foreach ($response->getHeaders() as $header) {
         if ($header instanceof MultipleHeaderInterface) {
             header($header->toString(), false);
             continue;
         }
         header($header->toString());
     }
     $status = $response->renderStatusLine();
     header($status);
     echo $response->getContent();
 }
开发者ID:moln,项目名称:gzfextra,代码行数:13,代码来源:Application.php

示例6: createSymfonyResponse

 /**
  * Converts a zend response to a symfony response.
  *
  * @param \Zend\Http\Response $response
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected static function createSymfonyResponse(ZendResponse $response)
 {
     $content = $response->getContent();
     $status = $response->getStatusCode();
     $zendHeaders = $response->getHeaders();
     $headers = array();
     foreach ($zendHeaders as $header) {
         $name = $header->getFieldName();
         $headers[$name] = $header->getFieldValue();
     }
     return new SymfonyResponse($content, $status, $headers);
 }
开发者ID:reenl,项目名称:stack-zf2,代码行数:18,代码来源:ZendHttpKernel.php


注:本文中的Zend\Http\Response::getContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。