當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。