getRawBody() 공개 메소드

Returns the raw HTTP request body.
public getRawBody ( ) : string
리턴 string the request body
예제 #1
0
 public function getRawBody()
 {
     $rawBody = parent::getRawBody();
     $contentEncoding = $this->headers->get('Content-Encoding', 'identity');
     switch ($contentEncoding) {
         case 'gzip':
             $rawBody = @gzdecode($rawBody);
             if ($rawBody !== false) {
                 return $rawBody;
             }
             throw new BadRequestHttpException('Request body(gziped) is broken.');
         case 'identity':
             return $rawBody;
         default:
             throw new UnsupportedMediaTypeHttpException('Unsupported Content-Encoding: ' . $contentEncoding);
     }
 }