Returns the raw HTTP request body.
@return string the request body
354151
public function getRawBody()
    {
        if ($this->_rawBody === null) {
            $this->_rawBody = $this->swooleRequest->rawContent();
        }
        return $this->_rawBody;
    }
867573
public function getRequestMethod()
    {
        if (isset($this->request->server['http_x_http_method_override'])) {
            return strtoupper($this->request->server['http_x_http_method_override']);
        }
        if (isset($this->request->server['request_method'])) {
            return strtoupper($this->request->server['request_method']);
        }

        return 'GET';
    }
607101
public function body()
	{
		$msg = $this->getMessage();
		
		if (422 == $this->getCode() && !empty($msg)) {
			$this->extra['errors'] = json_decode($msg, true);
			$msg = null;
		}
		
		if (empty($msg)) {
			switch ($this->getCode()) {
				case 404:
					$msg = 'Not Found';
					break;
				case 405:
					$msg = 'Method Not Allowed';
					break;
				case 400:
					$msg = 'Bad Request';
					break;
				case 401:
					$msg = 'Unauthorized';
					break;
				case 402:
					$msg = 'Payment Required';
					break;
				case 403:
					$msg = 'Forbidden';
					break;
				case 422:
					$msg = 'Unprocessable Entity';
					break;
				case 410:
					$msg = 'Resource Deleted';
					break;
				case 500:
					$msg = 'Server Error';
					break;
				default:
					$msg = 'Error';
			}
		}
		
		$output = array(
			'status'  => $this->getCode(),
			'message' => $msg,
		);
		
		if (!empty($this->getExtra())) {
			$output = array_merge($output, $this->getExtra());
		}
		
		return $output;
	}
1286831
public function getBody()
    {
        if (in_array($this->getMethod(), array(RequestInterface::METHOD_GET, RequestInterface::METHOD_HEAD))) {
            return '';
        }

        return http_build_query($this->getRequestData());
    }
228887
protected function getRequest()
    {
        $request = new Request();

        $request->setUrl($this->getUrl())
            ->setHeaders($this->getHeaders())
            ->setParams($this->getRequestParams())
            ->setBody($this->getRequestBody())
            ->setUserIp($this->getUserIp());
      
        if (isset($_SERVER)) {
            $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null)
                ->setQueryString(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null);
        }
      
        if (isset($_GET)) {
            $request->setGet($_GET);
        }
        if (isset($_POST)) {
            $request->setPost($_POST);
        }
        
        if ($request->getMethod() === 'PUT') {
            $postData = array();
            parse_str($request->getBody(), $postData);
            $request->setPost($postData);
        }
        
        $extras = $this->getRequestExtras();
        if (!$extras) {
            $extras = array();
        }

        $request->setExtras($extras);
        
        if (isset($_SESSION) && is_array($_SESSION) && count($_SESSION) > 0) {
            $request->setSession($_SESSION);
        }
        return $request;
    }
900995
function parseBody()
    {
        $request = $this->getMessageObject();

        $reqID   = spl_object_hash($request);
        if ( isset(self::$_parsed[$reqID]) )
            // parse from cached
            return self::$_parsed[$reqID];

        if ($request->headers()->has('content-type')) {
            $contentType = \Poirot\Http\Header\renderHeaderValue($request, 'content-type');
            $contentType = strtolower($contentType);

        } else {
            // No Any Data Sent .....
            return array();
        }


        // Content-Type May be in form of:
        // application/x-www-form-urlencoded; charset=utf-8
        // when we call from jquery/ajax in exm.
        if ( false !== $pos = strpos($contentType, ';') )
            $contentType = substr($contentType, 0, $pos);


        switch ( $contentType )
        {
            case 'application/json':
                $parsedData = $this->_parseJsonDataFromRequest($request);
                break;

            case 'application/x-www-form-urlencoded':
                $parsedData = $this->_parseUrlEncodeDataFromRequest($request);
                break;
            case strpos($contentType, 'multipart') !== false:
                $parsedData = $this->_parseMultipartDataFromRequest($request);
                break;

            default:
                throw new \Exception(sprintf(
                    'Request Body Contains No Data or Unknown Content-Type (%s).'
                    , $contentType
                ));
        }


        return self::$_parsed[$reqID] = $parsedData;
    }
519683
public function getPostBody()
    {
        $body = [
            'message' => $this->getContent(),
        ];

        if ($this->link != null) {
            $body['link'] = $this->link->getUrl();
        }

        if ($this->image != null) {
            $body['media'] = $this->image;
        }

        if ($this->video != null) {
            $body['media'] = $this->video;
        }

        if ($this->params != null) {
            $body = array_merge($body, $this->params);
        }

        return $body;
    }
1210647
public function getBody()
    {
        if (!$this->_body instanceof StreamInterface) {
            if ($this->_body === null) {
                $body = $this->defaultBody();
            } elseif ($this->_body instanceof \Closure) {
                $body = \call_user_func($this->_body, $this);
            } else {
                $body = $this->_body;
            }

            $this->_body = Yii::ensureObject($body, StreamInterface::class);
        }
        return $this->_body;
    }
1329617
public function toString()
    {
        $request = Parser\RequestParser::buildStatusLine($this) . Http::NEW_LINE;
        $headers = Parser\RequestParser::buildHeaderFromMessage($this);

        foreach ($headers as $header) {
            $request.= $header . Http::NEW_LINE;
        }

        $request.= Http::NEW_LINE;
        $request.= (string) $this->getBody();

        return $request;
    }
998555
public function getPostBody()
    {
        $output = '';
        if ($this->isJson) {
            $jsonPretty = ($this->isJsonPretty ? JSON_PRETTY_PRINT : NULL);
            if (count($this->data) > 0) {
                $output = json_encode($this->data, $jsonPretty);
            }
        } elseif ($this->isXML) {
            $output = $this->data;
        } elseif (count($this->data) > 0) {
            $output = http_build_query($this->data);
        }

        return $output;
    }
983816
public function getBody()
    {
        $bodyObject = $this->response->getBody();

        $bodyObject->rewind();

        $length = $bodyObject->getContentLength();
        if ($length === false || $length <= 0) {
            return '';
        }

        return $bodyObject->read($length);
    }
1165113
public function getBody() {
		if ($this->body && isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) && $this->headers[self::HEADER_KEY_CONTENT_TYPE] == 'application/x-www-form-urlencoded') {
			return http_build_query($this->body);
		} elseif ((is_object($this->body) || is_array($this->body)) &&
			(!isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) || $this->headers[self::HEADER_KEY_CONTENT_TYPE] != 'multipart/form-data')) {
			return json_encode($this->serializer->sanitizeForSerialization($this->body));
		} else {
	      return $this->body;
	    }
	}
171090
public function getParsedBody()
    {
        if ($this->hasParsedBody === false) {
            $this->hasParsedBody = true;

            $body = (string)$this->getBody();
            if ($this->bodyParsers === null || $this->bodyParsers->has((string)$this->contentType) === false) {
                $this->parsedBody = $this->internalParseBody($body, (string)$this->contentType);
            } else {
                $closure = $this->bodyParsers->get((string)$this->contentType);
                $this->parsedBody = $closure($body);
            }
        }

        return $this->parsedBody;
    }
1063571
public function getRawHeaders(): string
    {
        if (null === $this->rawHeaders) {
            $rawHeaders       = \explode("\r\n\r\n", $this->getRawMessage(), 2);
            $this->rawHeaders = \current($rawHeaders);
        }

        return $this->rawHeaders;
    }
1220747
public function body() {
        $event = [];
        if (!empty($this->replyToken)) {
            $event['replyToken'] = $this->replyToken;
        }
        $event['type'] = $this->eventType();
        $event['timestamp'] = time();
        $event['source'] = $this->source;
        $event['message'] = $this->message;
        $result = ['events' => [$event]];
        return json_encode($result);
    }
1279255
public function getBody(): Parameters
	{
		if($this->parsedBody === null)
		{
			$this->parsedBody = new Body($this->getRawBody(), $this->getContentType());
		}

		return $this->parsedBody;
	}
541727
public function getBodyAsString(): string
    {
        $body = $this->getBody();
        if (is_string($body)) {
            return $body;
        }
        if (null === $body) {
            return '';
        }
        if (is_callable($body)) {
            ob_start();
            $body();

            return ob_get_clean();
        }
        /**
         * @var string|int|null
         */
        $contentLength = $this->getHeader('Content-Length');
        if (is_int($contentLength) || ctype_digit($contentLength)) {
            return stream_get_contents($body, (int) $contentLength);
        }

        return stream_get_contents($body);
    }