@param Request $request

@return Response
484882
public function dispatch(Request $request)
    {
        $oldRequest = $this->container->setInstance($request);

        ob_start();
        $response = $this->filterRequest($request);
        $response->addContent(ob_get_clean());

        if ($oldRequest) {
            $this->container->setInstance($oldRequest);
        }

        return $response;
    }
211661
public function handle(Request $request) : Response
    {
        try {
            return $this->handleRequest($request);
        } catch (HttpException $e) {
            return $this->handleHttpException($e, $request);
        } catch (\Throwable $e) {
            return $this->handleUncaughtException($e, $request);
        }
    }
1209047
public function store(Request $request)
    {
        $this->validate($request, ['thread_id' => ['required'], 'author_id' => ['required'], 'content' => ['required']]);

        $thread = Thread::find($request->input('thread_id'));
        $this->authorize('reply', $thread);

        $post = $this->model()->create($request->only(['thread_id', 'post_id', 'author_id', 'content']));
        $post->load('thread');

        return $this->response($post, $this->trans('created'), 201);
    }
320816
protected function processPost(Request $request)
    {
        $resource = $this->getResourceManager()->createNewInstance();
        return $this->processAction($request, 'POST', $resource);
    }
211225
public function run(Request $request) {
    // process the requested action
    ObjectFactory::getInstance('actionMapper')->processAction($request, $this->response);
    return $this->response;
  }
770582
public function send(Request $request)
    {
        $response = new SearchResponse();
        $rpbReq   = $this->createRpbMessage($request);
        $rpbResp  = $this->client->send($rpbReq, RiakMessageCodes::SEARCH_QUERY_REQ, RiakMessageCodes::SEARCH_QUERY_RESP);

        if ( ! $rpbResp instanceof RpbSearchQueryResp) {
            return $response;
        }

        $response->numFound = $rpbResp->num_found;
        $response->maxScore = $rpbResp->max_score;

        if ( ! $rpbResp->hasDocs()) {
            return $response;
        }

        $response->docs = array_map([$this, 'docToArray'], $rpbResp->docs);

        return $response;
    }
1279098
public function sendRequest(Request $request)
    {
        $response = $this->httpClient->send($request);

        $this->checkErrorResponse($response);

        return $response;
    }
1321452
public function addTranslationAction(Request $request): Response
    {
        $form = $this->contentTypeFormFactory->addContentTypeTranslation(
            new TranslationAddData()
        );
        $form->handleRequest($request);

        /** @var TranslationAddData $data */
        $data = $form->getData();
        $contentType = $data->getContentType();
        $contentTypeGroup = $data->getContentTypeGroup();

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (TranslationAddData $data) {
                $contentType = $data->getContentType();
                $language = $data->getLanguage();
                $baseLanguage = $data->getBaseLanguage();
                $contentTypeGroup = $data->getContentTypeGroup();

                try {
                    $contentTypeDraft = $this->tryToCreateContentTypeDraft($contentType);
                } catch (BadStateException $e) {
                    $userId = $contentType->modifierId;
                    $this->notificationHandler->error(
                        $this->translator->trans(
                            /** @Desc("Draft of the Content Type '%name%' already exists and is locked by '%userContentName%'") */
                            'content_type.edit.error.already_exists',
                            ['%name%' => $contentType->getName(), '%userContentName%' => $this->getUserNameById($userId)],
                            'content_type'
                        )
                    );

                    return $this->redirectToRoute('ezplatform.content_type.view', [
                        'contentTypeGroupId' => $contentTypeGroup->id,
                        'contentTypeId' => $contentType->id,
                    ]);
                }

                return new RedirectResponse($this->generateUrl('ezplatform.content_type.update', [
                    'contentTypeId' => $contentTypeDraft->id,
                    'contentTypeGroupId' => $contentTypeGroup->id,
                    'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null,
                    'toLanguageCode' => $language->languageCode,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirectToRoute('ezplatform.content_type.view', [
            'contentTypeGroupId' => $contentTypeGroup->id,
            'contentTypeId' => $contentType->id,
        ]);
    }
1241426
public function handle(Request $request)
	{
		// execute response
		$response = $this->next($request);

		// check for presence of callback param
		// if we have one lets replace response content with a function executing the 
		// current response content
		if ($callback = $request->getVar('callback', null))
		{
			$response->headers->set('content-type', 'application/javascript');
			$response->setContent(sprintf('%s(%s);', $callback, $response->getContent()));
		}

		// return response
		return $response;
	}
822522
public function sendRequest(Request $request)
    {
        try {
            $rawResponse = $this->processRequest($request);
        } catch (Exception $exception) {
            if ($this->successor) {
                return $this->successor->sendRequest($request);
            }
            throw $exception;
        }

        $response = new Response($request, $rawResponse);

        if ($response->isError()) {
            throw $response->getThrownException();
        }

        return $response;
    }
578478
public function execute (Request $request)
		{
			$parsed = $this->parseRouteRequest($request);

			$controller = $this->getController($request);

			return $controller->dispatch(
				$parsed['method'],
				$parsed['arguments']
			);
		}
265971
public function render(?Request $request = null): Response {
        $request = self::validateRequest($request);

        $translator = $this->translatorProvider->getPreferredTranslator(
            $request->getLanguages(),
            $this->config['default_language']
        );

        $response = new Response();

        $response->setContent($this->templateRenderer->render(
            $this->config['template_name'],
            array_merge($translator->getTranslations(), [
                'lang' => $translator->getLanguage(),
                'charset' => $this->config['charset']
            ])
        )."\n<!-- Powered by progminer/maintenance-screen (https://packagist.org/packages/progminer/maintenance-screen) -->\n");
        $response->headers->set('Content-Language', $translator->translate('lang'));

        return $response;
    }
79715
public function send(Request $request)
    {
        $response   = new PutResponse();
        $rpbPutReq  = $this->createRpbMessage($request);

        $this->client->send($rpbPutReq, RiakMessageCodes::SET_BUCKET_REQ, RiakMessageCodes::SET_BUCKET_RESP);

        return $response;
    }
499543
public function register(Request $request): Response
    {
        $contentTypeIdentifier = $this->getConfigResolver()->getParameter('user.content_type_identifier', 'ngsite');
        $contentType = $this->getRepository()->getContentTypeService()->loadContentTypeByIdentifier($contentTypeIdentifier);
        $languages = $this->getConfigResolver()->getParameter('languages');
        $userCreateStruct = $this->userService->newUserCreateStruct(
            null,
            null,
            null,
            $languages[0],
            $contentType
        );

        $userCreateStruct->enabled = (bool) $this->getConfigResolver()->getParameter('user.auto_enable', 'ngsite');
        $userCreateStruct->alwaysAvailable = (bool) $contentType->defaultAlwaysAvailable;

        $data = new DataWrapper($userCreateStruct, $userCreateStruct->contentType);

        $formBuilder = $this->formFactory->createBuilder(
            CreateUserType::class,
            $data,
            [
                'translation_domain' => 'ngsite_user',
            ]
        );

        $form = $formBuilder->getForm();
        $form->handleRequest($request);

        if (!$form->isValid()) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.register', 'ngsite'),
                [
                    'form' => $form->createView(),
                ]
            );
        }

        $users = $this->userService->loadUsersByEmail($form->getData()->payload->email);

        if (!empty($users)) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.register', 'ngsite'),
                [
                    'form' => $form->createView(),
                    'error' => 'email_in_use',
                ]
            );
        }

        try {
            $this->userService->loadUserByLogin($form->getData()->payload->login);

            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.register', 'ngsite'),
                [
                    'form' => $form->createView(),
                    'error' => 'username_taken',
                ]
            );
        } catch (NotFoundException $e) {
            // do nothing
        }

        $userGroupId = $this->getConfigResolver()->getParameter('user.user_group_content_id', 'ngsite');

        $preUserRegisterEvent = new UserEvents\PreRegisterEvent($data->payload);
        $this->eventDispatcher->dispatch(SiteEvents::USER_PRE_REGISTER, $preUserRegisterEvent);
        $data->payload = $preUserRegisterEvent->getUserCreateStruct();

        /** @var \eZ\Publish\API\Repository\Values\User\User $newUser */
        $newUser = $this->getRepository()->sudo(
            static function (Repository $repository) use ($data, $userGroupId): User {
                $userGroup = $repository->getUserService()->loadUserGroup($userGroupId);

                return $repository->getUserService()->createUser(
                    $data->payload,
                    [$userGroup]
                );
            }
        );

        $userRegisterEvent = new UserEvents\PostRegisterEvent($newUser);
        $this->eventDispatcher->dispatch(SiteEvents::USER_POST_REGISTER, $userRegisterEvent);

        if ($newUser->enabled) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.register_success', 'ngsite')
            );
        }

        if ($this->getConfigResolver()->getParameter('user.require_admin_activation', 'ngsite')) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.activate_admin_activation_pending', 'ngsite')
            );
        }

        return $this->render(
            $this->getConfigResolver()->getParameter('template.user.activate_sent', 'ngsite')
        );
    }
1050194
public function handle(Request $request)
	{
		// execute response
		$response = $this->next($request);

		// only do this if user wants it expanded
		if (!$expand = $request->getVar('expand', null))
		{
			return $response;
		}

		// normalize keys
		$expandKeys = $this->normalizeExpandKeys($expand);

		// only do on json data
		if (!$response->isJson())
		{
			return $response;
		}

		// get the response content and json decode
		$content = json_decode($response->getContent());

		// make sure to handle array different then a single object
		if (is_array($content))
		{
			// loop through each item in array and covert dates
			foreach ($content as $key => $value)
			{
				$content[$key] = $this->convertExpandKeysInObjects($expandKeys, $value);
			}
		}
		else
		{
			// convert single object dates
			$content = $this->convertExpandKeysInObjects($expandKeys, $content);
		}

		// set the response content to modified content
		$response->setContent(json_encode($content));

		// return response
		return $response;
	}
736124
public function postAction(Request $request)
    {
        $type = 'page';
        $language = $this->getLanguage($request);
        $action = $request->get('action');

        $this->checkActionParameterSecurity($action, $language);

        $document = $this->getDocumentManager()->create($type);
        $formType = $this->getMetadataFactory()->getMetadataForAlias($type)->getFormType();

        $this->persistDocument($request, $formType, $document, $language);
        $this->handleActionParameter($action, $document, $language);
        $this->getDocumentManager()->flush();

        $context = new Context();
        $context->setGroups(['defaultPage']);

        return $this->handleView($this->view($document)->setContext($context));
    }
743424
public function send(Request $request)
    {
        $this->logger()->debug('Sending request. {request}', [
            'request'  => $request,
        ]);

        $response = $this->sendOrRetry($request, $request->getRetries());

        $this->logger()->debug('Response received. {response}', [
            'request'  => $request,
            'response' => $response,
        ]);

        return $response;
    }