Get request message.

@throws BadRequestException

@return array
971053
public function getMessage()
    {
        $message = $this->parseMessageFromRequest($this->request->getContent(false));

        if (!is_array($message) || empty($message)) {
            throw new BadRequestException('Invalid request.');
        }

        return $message;
    }
463014
public function getRequest()
    {
        if (is_null($this->request)) {
            $this->setRequest(app()->refresh('request', $this, 'setRequest'));
        }

        return $this->request;
    }
75554
public function getMessage()
    {
        if ($this->displayErrorDetails() && $this->hasThrown()) {
            return $this->getThrown()->getMessage();
        } else {
            return $this->translator()->translate(
                'The server encountered a problem. Sorry for the temporary inconvenience.',
                [],
                'charcoal'
            );
        }
    }
627125
private function _request()
    {
        $res = $this->_client->request(
            $this->_method,
            $this->_endpoint . '?' . $this->_query_parameters,
            [
                'headers' => $this->_headers,
                'http_errors' => false
            ]
        );
        return array(
            'code' => $res->getStatusCode(),
            'body' => new SimpleXMLElement($res->getBody())
        );
    }
1277551
public function getMessages()
    {
        if ($this->event->get('MsgType') === 'text') {
            $text = $this->event->get('Content');
        } else {
            $text = $this->event->get('Url');
        }

        return [
            new IncomingMessage($text, $this->event->get('FromUserName'),
                $this->event->get('ToUserName'), $this->event),
        ];
    }
587512
public function getMessage()
    {
        $result = [];

        $messages = (isset($this->indexReverse[self::MESSAGE])) ? $this->indexReverse[self::MESSAGE] : [];

        foreach ($messages as $index) {
            $result[] = $this->getChild($index);
        }

        return $result;
    }
535349
public function getInternalRequest()
    {
        if (null === $this->internalRequest) {
            @trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
            // throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
        }

        return $this->internalRequest;
    }
850498
protected function _getJsonRpcRequest() {
        if ($this->getRequest()->getPost('request')) {
            return $this->getRequest()->getPost('request');
        }
        return $request = $this->getRequest()->getRawBody();
    }
633074
protected function badRequest(string $message = 'Bad request.'): Response
    {
        return $this->getResponse()
            ->setContent($message)
            ->setStatusCode(Response::HTTP_BAD_REQUEST);
    }
135173
protected function _processIds()
    {
        $ids = $this->_controller()->request->getData('id');

        $all = false;
        if (is_array($ids)) {
            $all = Hash::get($ids, '_all', false);
            unset($ids['_all']);
        }

        if (!is_array($ids)) {
            throw new BadRequestException('Bad request data');
        }

        if ($all) {
            foreach ($ids as $key => $value) {
                $ids[$key] = 1;
            }
            $ids = array_keys($ids);
        }

        $ids = array_filter($ids);

        return array_values($ids);
    }
1294157
public function requestCorrect()
    {
        $request = $this->getRequest();
        $rawRequestData = $request->getPost();

        $responseDoVerifyWithPayPal = $this->doVerifyWithPayPal($rawRequestData);

        $ipnRequestValidator = $this->getIPNRequestValidator();
        $ipnRequestValidator->setPayPalRequest($rawRequestData);
        $ipnRequestValidator->setPayPalResponse($responseDoVerifyWithPayPal);
        $ipnRequestValidator->setShopOwnerUserName($this->getShopOwner());

        $requestCorrect = $ipnRequestValidator->isValid();
        if (!$requestCorrect) {
            $failureMessage = $ipnRequestValidator->getValidationFailureMessage();
            $this->setFailureMessage($failureMessage);
        }

        return $requestCorrect;
    }
32670
public function getPayload()
    {
        $payload = $this->payload;

        // The "message" property is deprecated and replaced by "error_description"
        // TODO: remove "message" property
        if (isset($payload['error_description']) && !isset($payload['message'])) {
            $payload['message'] = $payload['error_description'];
        }

        return $payload;
    }
1029031
public function getMessageList()
    {
        $output =  array();
        if ($this->CreatedCount()) {
            $output['created'] = _t(
                'BulkLoader.IMPORTEDRECORDS', "Imported {count} new records.",
                array('count' => $this->CreatedCount())
            );
        }
        if ($this->UpdatedCount()) {
            $output['updated'] = _t(
                'BulkLoader.UPDATEDRECORDS', "Updated {count} records.",
                array('count' => $this->UpdatedCount())
            );
        }
        if ($this->DeletedCount()) {
            $output['deleted'] =  _t(
                'BulkLoader.DELETEDRECORDS', "Deleted {count} records.",
                array('count' => $this->DeletedCount())
            );
        }
        if ($this->SkippedCount()) {
            $output['skipped'] =  _t(
                'BulkLoader.SKIPPEDRECORDS', "Skipped {count} bad records.",
                array('count' => $this->SkippedCount())
            );
        }

        if (!$this->CreatedCount() && !$this->UpdatedCount()) {
            $output['empty'] = _t('BulkLoader.NOIMPORT', "Nothing to import");
        }

        return $output;
    }
382432
public function exceptions()
    {
        return [
            400 => [
                'message' => 'The request cannot be fulfilled due to bad syntax.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\BadRequestException; }
            ],
            401 => [
                'message' => 'Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\UnauthorizedException; }
            ],
            403 => [
                'message' => 'The request was a valid request, but the server is refusing to respond to it.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\ForbiddenException; }
            ],
            404 => [
                'message' => 'The requested resource could not be found but may be available again in the future.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\NotFoundException; }
            ],
            405 => [
                'message' => 'A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\MethodNotAllowedException; }
            ],
            406 => [
                'message' => 'The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\NotAcceptableException; }
            ],
            409 => [
                'message' => 'Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\ConflictException; }
            ],
            410 => [
                'message' => 'Indicates that the resource requested is no longer available and will not be available again.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\GoneException; }
            ],
            411 => [
                'message' => 'The request did not specify the length of its content, which is required by the requested resource.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\LengthRequiredException; }
            ],
            412 => [
                'message' => 'The server does not meet one of the preconditions that the requester put on the request.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\PreconditionFailedException; }
            ],
            415 => [
                'message' => 'The request entity has a media type which the server or resource does not support.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\UnsupportedMediaException; }
            ],
            417 => [
                'message' => 'The server cannot meet the requirements of the Expect request-header field.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\ExpectationFailedException; }
            ],
            428 => [
                'message' => 'The origin server requires the request to be conditional.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\PreconditionRequiredException; }
            ],
            429 => [
                'message' => 'The user has sent too many requests in a given amount of time.',
                'throw'   => function(){ throw new \League\Route\Http\Exception\TooManyRequestsException; }
            ],
            451 => [
                'message' => 'The resource is unavailable for legal reasons..',
                'throw'   => function(){ throw new \League\Route\Http\Exception\UnavailableForLegalReasonsException; }
            ]
        ];
    }
262024
public function toMessage()
    {
        $m = new Message(array(
            $this->getRequestId(),
            $this->getActionName(),
        ));
        $m->append($this->getParameters());

        return $m;
    }
1172434
protected function getRequest()
    {
        $url = $this->buildUrl($this->getBody());

        $response = $this->client->get($url, [
            'auth'    => $this->getAuth(),
            'headers' => [
                'Accept' => 'application/json',
            ],
        ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API.');
        }

        return $response;
    }
649036
private function getModelAttribute()
    {
        $attribute = Yii::$app->request->post('name');

        if ($attribute === null) {
            throw new BadRequestHttpException('Attribute cannot be empty.');
        }

        if (strpos($attribute, '.')) {
            $attributePath = explode('.', $attribute);

            return array_pop($attributePath);
        }

        return $attribute;
    }