@param BaseRequest $request
@param int $type
@param bool $catch

@return \Symfony\Component\HttpFoundation\Response
344998
public function handle(BaseRequest $request, $type = self::MASTER_REQUEST, $catch = true)
    {
        $request        = new Request($request);
        $mimeProcResult = $this->processMime(
            (new FormatNegotiator())->getBest($request->headers->get('Accept', '*/*'))->getValue()
        );

        $request->setApiVersion(
            str_pad($mimeProcResult->apiVersion, 3, '.0')
        );

        return $this->app->handle($request, $type, $catch);
    }
693707
public function settingsPostAction(Request $request, BasePage $page)
    {
        return new JsonResponse(parent::settingsPostAction($request, $page));
    }
1035364
function fetchInput( $http, $base )
    {
        $dataType = $this->dataType();
        if ( $dataType )
            return $dataType->fetchObjectAttributeHTTPInput( $http, $base, $this );

        return false;
    }
1169181
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $rootRequest = new RootRequest($request);
        return $handler->handle($rootRequest);
    }
966943
public function filterAction(Request $request, $endpoint)
    {
        $form = $this->createForm(CropType::class);

        $form->handleRequest($request);

        // Form invalid. Exit.
        if (!$form->isValid()) {
            return $this->createErrorResponse(
                $this->get('translator')->trans('Invalid crop parameters')
            );
        }

        // Else process crop
        try {
            return new JsonResponse(
                $this->get('jb_fileuploader.croper')->crop($endpoint, $form->getData())
            );
        } catch (\Exception $e) {
            return $this->createErrorResponse($e->getMessage());
        }
    }
340188
private function executeInterceptor($type, Request $request, Response $response) {
		foreach ($this->interceptor[$type] as $it) {
			if (isset($it['all'])) {
				if ($it['handler']->{$type}($request, $response) !== null) {
					return true;
				}
			} elseif (isset($it['uri'])) {
				if ($request->uri === $it['uri']) {
					if ($it['handler']->{$type}($request, $response) !== null) {
						return true;
					}
				}
			} else {
				if (preg_match($it['regex'], $request->uri)) {
					if ($it['handler']->{$type}($request, $response) !== null) {
						return true;
					}
				}
			}
		}
		return null;
	}
156302
protected function ExecuteCall(string $actionName, $request, int $responseType = GnResponseType::Json, bool $ignoreNotFound = FALSE, int $cacheTtl = 0)
    {
        $this->HandleCallQuota();

        $url = GnApi::ApiRoot() . "/{$this->ControllerBasePath}/{$actionName}";

        if ($this->_loginApi) {
            $urlParams = [];
            // login needed?
            if ($this->_loginApi->getIsLoggedIn()) {
                $urlParams["lid"] = $this->_loginApi->getLoginId();
            }

            // ..language
            $urlParams["lang"] = $this->_loginApi->getLangId();
            $url = GnUtility::GetQueryStringFromKeyVals($url, $urlParams);

            // app-key needed?
            if (!GnUtil::IsNullOrEmpty($this->_loginApi->getAppKey())) {
                $request->appKey = $this->_loginApi->getAppKey();
            }
        }

        $reqJson = json_encode($request);

        // setup cache
        $this->cacheGroup = $this->GetCacheGroup($actionName);
        $this->cacheKey = "{$url}#{$reqJson}";
        if ($cacheTtl == 0) {
            $cacheTtl = self::DEFAULT_CACHE_TTL_MINUTES * 60;
        } elseif ($cacheTtl == PHP_INT_MAX) {
            $cacheTtl = 0;
        }

        if (GnApi::$Debug) {
            GnLogger::Verbose("Request:" . $url . " | " . $actionName . " | " . $reqJson . " | " . $responseType);
        }

        // use cache|POST to read the result
        $resData = GnCache::Instance()->GetCachedItem($this->cacheKey, $this->cacheGroup, $cacheTtl, function () use ($url, $reqJson) {
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $reqJson);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'Content-Type:application/json'
            ));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
            $result = curl_exec($ch);
            curl_close($ch);

            return $result;
        });

        if (strlen($resData) == 0) {
            $this->ResetCachedResut();
            return NULL;
        }

        $json = json_decode($resData);

        if ($json === NULL) {
            if (GnApi::$Debug) {
                GnLogger::Verbose("Response:" . $actionName . " | " . (ctype_print($resData) || substr($resData, 0, 1) === '<' ? $resData : "binary") . " | " . $responseType);
            }
            return $resData;
        } else {
            if (GnApi::$Debug) {
                GnLogger::Verbose("Response:" . $actionName . " | " . $resData . " | " . $responseType);
            }

            // ok or err?
            $errCode = $json->{"ErrorCode"} + 0;
            if ($errCode > 0) {
                $this->ResetCachedResut();

                $msg = $json->{"Message"};
                if (GnApi::$Debug) {
                    GnLogger::Error("GpsNose API error: {$msg}");
                }
                throw new GnException("GpsNose API error: {$msg}");
            }

            switch ($responseType) {

                case GnResponseType::Json:
                    return $json;

                case GnResponseType::Boolean:
                    return strtoupper($resData) == 'TRUE';

                case GnResponseType::Number:
                    return $resData + 0;

                case GnResponseType::String:
                    return $json;

                case GnResponseType::GnLogin:
                    return new GnLogin($json);

                case GnResponseType::GnCommunity:
                    return new GnCommunity($json);

                case GnResponseType::GnComment:
                    return new GnComment($json);

                case GnResponseType::GnMashupStorageItem:
                    return new GnMashupStorageItem($json);

                case GnResponseType::GnMapRectangle:
                    return new GnMapRectangle($json);

                case GnResponseType::ListGnMashup:
                    $mashups = array();
                    foreach ($json as $item) {
                        array_push($mashups, new GnMashup($item));
                    }
                    return $mashups;

                case GnResponseType::ListGnNose:
                    $noses = array();
                    foreach ($json as $item) {
                        array_push($noses, new GnNose($item));
                    }
                    return $noses;

                case GnResponseType::ListGnNews:
                    $news = array();
                    foreach ($json as $item) {
                        array_push($news, new GnNews($item));
                    }
                    return $news;

                case GnResponseType::ListGnMembers:
                    $members = array();
                    foreach ($json as $key => $val) {
                        array_push($members, new GnMember($key, $val));
                    }
                    return $members;

                case GnResponseType::ListGnImpression:
                    $impressions = array();
                    foreach ($json as $item) {
                        array_push($impressions, new GnImpression($item));
                    }
                    return $impressions;

                case GnResponseType::ListGnPoI:
                    $pois = array();
                    foreach ($json as $item) {
                        array_push($pois, new GnPoI($item));
                    }
                    return $pois;

                case GnResponseType::ListGnEvent:
                    $events = array();
                    foreach ($json as $item) {
                        array_push($events, new GnEvent($item));
                    }
                    return $events;

                case GnResponseType::ListGnTrack:
                    $tracks = array();
                    foreach ($json as $item) {
                        array_push($tracks, new GnTrack($item));
                    }
                    return $tracks;

                case GnResponseType::ListGnComment:
                    $comments = array();
                    foreach ($json as $item) {
                        array_push($comments, new GnComment($item));
                    }
                    return $comments;

                case GnResponseType::ListGnMashupToken:
                    $mashupTokens = array();
                    foreach ($json as $item) {
                        array_push($mashupTokens, new GnMashupToken($item));
                    }
                    return $mashupTokens;
                    break;

                case GnResponseType::ListGnMail:
                    $mails = array();
                    foreach ($json as $item) {
                        array_push($mails, new GnMail($item));
                    }
                    return $mails;
                    break;

                case GnResponseType::ListGnMashupStorageItem:
                    $mashupStorgeItems = array();
                    foreach ($json as $item) {
                        array_push($mashupStorgeItems, new GnMashupStorageItem($item));
                    }
                    return $mashupStorgeItems;
                    break;

                default:
                    echo $responseType;
                    die();
            }
        }
    }
348731
public function handle($request, Closure $next, $type)
    {
        if (!$this->typeResolver->hasType($this->tenant->getTenantCreator(), $type)) {
            return redirect()->route('tenant.tenant_type_not_supported', ['type' => $type]);
        }

        return $next($request);
    }
306025
public function setRequestType ($type = FALSE)
	{
		
		// If there is a request argument
		
		if ($type !== FALSE)
		{
			
			// Set it
			
			$this->requestType	= $type;
			
		}
		
		// Else if there is a request format URL variable
		
		else if (isset ($_GET['request_type']))
		{
			
			// Set it
			
			$this->requestType	= $_GET['request_type'];
			
		}
		
	}
1070397
protected function filterResponse(Response $response, Request $request, $type)
    {
        $event = new FilterResponseEvent($this, $request, $type, $response);
        $this->getDispatcher()->dispatch(KernelEvents::RESPONSE, $event);

        return $event->getResponse();
    }
292091
public function dispatch(ServerRequestInterface $request)
    {
        if ($this->routeMatched) {
            if (!is_subclass_of($this->actionNamespace, 'App\Action\AppAction')) {
                throw new BaseException(
                    sprintf('Action "%s" does not extend App\Action\AppAction', $this->actionNamespace)
                );
            }

            $actionInstance = new $this->actionNamespace();

            $beforeDispatchEvent = $this->dispatchEvent(
                self::EVENT_BEFORE_DISPATCH,
                $this,
                ['request' => $request, 'action' => $actionInstance]
            );

            if ($beforeDispatchEvent->getResult() instanceof Response) {
                return $beforeDispatchEvent->getResult();
            }

            $response = call_user_func_array([$actionInstance, 'invoker'], $this->params);
            $this->dispatchEvent(self::EVENT_AFTER_DISPATCH, $this, ['request' => $request, 'response' => $response]);

            return $response;
        } else {
            throw new NotFoundException(
                sprintf('Route "%s" does not found', $request->getServerParams()['REQUEST_URI'])
            );
        }
    }
240825
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
	{
		[
			'Request-Type' => $type,
			'Response-Headers' => $headers,
		] = $this->analyze($request);

		switch ($type) {
			case self::ERROR_NO_HOST_HEADER:
			case self::ERROR_ORIGIN_NOT_ALLOWED:
			case self::ERROR_METHOD_NOT_SUPPORTED:
			case self::ERROR_HEADERS_NOT_SUPPORTED:
				return Factory::response(403);

			case self::TYPE_REQUEST_OUT_OF_CORS_SCOPE:
				return $handler->handle($request);

			case self::TYPE_PRE_FLIGHT_REQUEST:
				$response = Factory::response(200);

				return self::withCorsHeaders($response, $headers);

			default:
				$response = $handler->handle($request);

				return self::withCorsHeaders($response, $headers);
		}
	}
565405
public function handleException(ServerRequestInterface $request, ResponseInterface $response, BaseException $exception)
    {
        return $this
            ->getContentTypeHandler($request)
            ->handleException($request, $response, $exception);
    }
797618
public function receiveRequest(Request $request): Response
    {
        $curie = $request::schema()->getCurie();
        $curieStr = $curie->toString();

        if (isset($this->handlers[$curieStr])) {
            $handler = $this->handlers[$curieStr];
        } else {
            try {
                $handler = $this->locator->getRequestHandler($curie);
            } catch (\Throwable $e) {
                return $this->createResponseForFailedRequest($request, $e);
            }

            $this->handlers[$curieStr] = $handler;
        }

        try {
            $request->freeze();
            $response = $handler->handleRequest($request, $this->locator->getPbjx());
            $response->set('ctx_request_ref', $request->generateMessageRef());
            if ($request->has('ctx_correlator_ref')) {
                $response->set('ctx_correlator_ref', $request->get('ctx_correlator_ref'));
            }

            return $response;
        } catch (\Throwable $e) {
            return $this->createResponseForFailedRequest($request, $e);
        }
    }
1117368
private function doUpload ($endpoint, $type, $body)
    {
        return json_decode(
            $this->client->send(
                new Request(
                    'POST',
                    Uri::withQueryValue(new Uri($endpoint), 'type', $type),
                    [],
                    $body
                )
            )->getBody()
        );
    }
1081428
private function send(Response $response, $type = self::MASTER_REQUEST)
    {
        if (null !== $this->application && null !== $this->application->getEventDispatcher()) {
            $event = new FilterResponseEvent($this, $this->getRequest(), $type, $response);
            $this->application->getEventDispatcher()->dispatch('frontcontroller.response', $event);
            $this->application->getEventDispatcher()->dispatch(KernelEvents::RESPONSE, $event);
        }

        $response->send();
        $this->response = $response;
        $this->application->stop();
    }
630560
protected function init($request, $builder, $type = 'builder')
    {
        $this->request    = $request;
        $this->query_type = $type;
        $this->columns    = $builder->columns;
        $this->connection = $builder->getConnection();
        $this->prefix     = $this->connection->getTablePrefix();
        $this->database   = $this->connection->getDriverName();
        if ($this->isDebugging()) {
            $this->connection->enableQueryLog();
        }
    }