Return a subclass of tornado.web.RequestHandler and
        apply required setting.
357444
def as_view(cls, view_type, *init_args, **init_kwargs):
        
        global _method

        new_cls = type(
            cls.__name__ + '_' + _BridgeMixin.__name__ + '_restless',
            (_BridgeMixin, cls._request_handler_base_,),
            dict(
                __resource_cls__=cls,
                __resource_args__=init_args,
                __resource_kwargs__=init_kwargs,
                __resource_view_type__=view_type)
        )

        """
        Add required http-methods to the newly created class
        We need to scan through MRO to find what functions users declared,
        and then add corresponding http-methods used by Tornado.
        """
        bases = inspect.getmro(cls)
        bases = bases[0:bases.index(Resource)-1]
        for k, v in cls.http_methods[view_type].items():
            if any(v in base_cls.__dict__ for base_cls in bases):
                setattr(new_cls, k.lower(), _method)

        return new_cls
770970
def ProcessRequest(self, method_config, request):
        """"""
        if self.log_request:
            logging.info(
                'Calling method %s with %s: %s', method_config.method_id,
                method_config.request_type_name, request)
        return request
1188243
function toRestifyHandler(handler) {
        if ((typeof handler === 'function') && (handler.length !== 3)) {
            //Wrap `virgilio-http` type handlers.
            handler = restifyHandler.bind(this, handler);
        }
        return handler;
    }
881467
def handler(self, value):
        

        if value is not None:
            assert issubclass(value, SocketServer.BaseRequestHandler), \
                "'{0}' attribute: '{1}' is not 'SocketServer.BaseRequestHandler' subclass!".format("handler", value)
        self.__handler = value
        self.__handler.container = self
973616
public static function applyRequestHandler(RequestHandlerBase $requestHandler): callable
    {
        return function (callable $handler) use ($requestHandler) {
            return function ($request, array $options) use ($handler, $requestHandler) {
                return $handler($requestHandler->execute($request), $options);
            };
        };
    }
953580
def user_to_request(handler):
    ''''''
    @wraps(handler)
    async def decorator(*args):
        request = _get_request(args)
        request[cfg.REQUEST_USER_KEY] = await get_cur_user(request)
        return await handler(*args)
    return decorator
1118618
def request_middleware(api=None):
    """"""
    def decorator(middleware_method):
        apply_to_api = hug.API(api) if api else hug.api.from_object(middleware_method)

        class MiddlewareRouter(object):
            __slots__ = ()

            def process_request(self, request, response):
                return middleware_method(request, response)

        apply_to_api.http.add_middleware(MiddlewareRouter())
        return middleware_method
    return decorator
680754
def process_request(self, request):
        """"""
        batcher = PrioritizedBatcher.global_instance()
        if batcher.is_started:
            # This can happen in old-style middleware if consequent middleware
            # raises exception and thus `process_response` is not called.
            # Described under 3rd point of differences:
            # https://docs.djangoproject.com/en/1.11/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware
            batcher.rollback()
            logger.warning(
                "Uncommited batcher transaction from previous request was rollbacked."
            )

        batcher.start()
1036648
async def _request(self, method: str, url: str, headers: Mapping[str, str],
                       body: bytes = b'') -> Tuple[int, Mapping[str, str], bytes]:
        """"""
        if method == "GET" and not body:
            real_body = None
        else:
            real_body = body
        request = httpclient.HTTPRequest(url, method, headers, real_body)
        # Since Tornado has designed AsyncHTTPClient to be a singleton, there's
        # no reason not to simply instantiate it every time.
        client = httpclient.AsyncHTTPClient()
        response = await client.fetch(request, raise_error=False)
        return response.code, response.headers, response.body
129213
function( mockHandler, requestSettings ) {
			if ( mockHandler.logging === false ||
				 ( typeof mockHandler.logging === 'undefined' && $.mockjaxSettings.logging === false ) ) {
				return;
			}
			if ( window.console && console.log ) {
				var message = 'MOCK ' + requestSettings.type.toUpperCase() + ': ' + requestSettings.url;
				var request = $.extend({}, requestSettings);

				if (typeof console.log === 'function') {
					console.log(message, request);
				} else {
					try {
						console.log( message + ' ' + JSON.stringify(request) );
					} catch (e) {
						console.log(message);
					}
				}
			}
		}
47912
async def dispatch(self, request, view=None, **kwargs):
        """"""
        if view is None and request.method not in self.methods:
            raise HTTPMethodNotAllowed(request.method, self.methods)

        method = getattr(self, view or request.method.lower())
        response = await method(request, **kwargs)
        return await self.make_response(request, response)
352167
def use(klass, *args, &block)
      request_handler   = "#{klass.name}::RequestHandler".safe_constantize
      response_handler  = "#{klass.name}::ResponseHandler".safe_constantize
      exception_handler = "#{klass.name}::ExceptionHandler".safe_constantize

      request_handlers   << request_handler.new(*args, &block) if request_handler
      response_handlers  << response_handler.new(*args, &block) if response_handler
      exception_handlers << exception_handler.new(*args, &block) if exception_handler
    end
1189533
def handler(self):
		''
		return ft.partial(self.base.handler, parameter=self.parameter)\
			if self.parameter else self.base.handler
715900
def get_handler(self, request):
        
        try:
            f = self._json_rpc_methods[request.method]

        except (AttributeError, KeyError):  # pragma no coverage
            raise RPCMethodError("Received invalid method '{}'".format(request.method))

        return f
680497
def reqresp_middleware(api=None):
    """"""
    def decorator(middleware_generator):
        apply_to_api = hug.API(api) if api else hug.api.from_object(middleware_generator)

        class MiddlewareRouter(object):
            __slots__ = ('gen', )

            def process_request(self, request, response):
                self.gen = middleware_generator(request)
                return self.gen.__next__()

            def process_response(self, request, response, resource, req_succeeded):
                return self.gen.send((response, resource))

        apply_to_api.http.add_middleware(MiddlewareRouter())
        return middleware_generator
    return decorator
82288
public <U> RequestHandler3<T, R, U> param(final Class<U> paramClass) {
    return new RequestHandler3<>(method, path, resolverParam1, resolverParam2, ParameterResolver.path(2, paramClass), errorHandler);
  }
1286597
private ServletRequestHandler newGetHttpRequestHandler() {
        return new ServletRequestHandler() {
            /** {@inheritDoc} */
            public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp) {
                return requestHandler.handleGetRequest(pReq.getRequestURI(),pReq.getPathInfo(), getParameterMap(pReq));
            }
        };
    }