Executes the request object aimed at the leader and process the response with given handler
Note: this method doesn't do retrying on errors or handle leader changes occurred during communication
774040
public <Intermediate, Final> ListenableFuture<Final> goAsync(
      final Request request,
      final HttpResponseHandler<Intermediate, Final> handler
  )
  {
    return httpClient.go(request, handler);
  }
1281776
function handleRequest(middleware, handlers, mode, checkArity, req, res, errorHandler) {
  const done = err => err && setImmediate(errorHandler, err, req, res);
  // run global middleware first, then start handling request
  // this is important to allow loggers for example to kick-in regardless
  runMiddlewareStack(middleware, req, res, (err) => {
    if (err) {
      done(err);
      return;
    }
    // try to apply supplied handlers to the requested operation
    handleOperation(handlers, mode, checkArity, req, res, done);
  });
}
685171
@Override
    public Object handle(Message msg) throws Exception {
        if(req_handler != null)
            return req_handler.handle(msg);
        return null;
    }
58242
def process(self, context, data):
        
        context.target_backend = self.requester_mapping[data.requester]
        return super().process(context, data)
722719
function handler() {
        try {
          if (this.readyState === this.DONE) {

            var response = _buildResponse(this, options.fullResponse);

            // Resolve or reject promise given the response status.
            // HTTP status of 2xx is considered a success.
            if (this.status >= 200 && this.status < 300) {

              if (successCallback) {
                Logger.warnCallbackDeprecation();
                successCallback(response);
              }
              resolve(response);

            } else {
              errorHandler(response);
            }
          }
        } catch (exception) {
          // Do nothing, will be handled by ontimeout.
        }
      }
249504
def process_exception(self, request, e):
        
        if isinstance(e, RedirectException):
            response = e.get_response()
            self.process_response(request, response)
243432
def __handler(self, connection, event):
        
        try:
            # Find local handler
            method = getattr(self, "on_{0}".format(event.type))
        except AttributeError:
            pass
        else:
            try:
                # Call it
                return method(connection, event)
            except Exception as ex:
                logging.exception("Error calling handler: %s", ex)
75628
def __handle_request(self, request, *args, **kw):
        

        self._authenticate(request)
        self._check_permission(request)
        method = self._get_method(request)
        data = self._get_input_data(request)
        data = self._clean_input_data(data, request)
        response = self._exec_method(method, request, data, *args, **kw)
        return self._process_response(response, request)
41855
public function execute()
    {
        set_error_handler([$this, 'processErrors'], E_WARNING);

        $stream = fopen($this->requestData['url'], 'r', false, $this->streamContext);

        $this->responseBody = stream_get_contents($stream);

        $this->responseHeaders = $http_response_header;

        $this->response = implode("\r\n", $http_response_header) . "\r\n\r\n" . $this->responseBody;

        restore_error_handler();
    }
443230
def process(self):
        

        response = None

        try:
            payload = self.receive()
            method, args, ref = self.parse(payload)
            response = self.execute(method, args, ref)

        except AuthenticateError as exception:
            logging.error(
                'Service error while authenticating request: {}'
                .format(exception), exc_info=1)

        except AuthenticatorInvalidSignature as exception:
            logging.error(
                'Service error while authenticating request: {}'
                .format(exception), exc_info=1)

        except DecodeError as exception:
            logging.error(
                'Service error while decoding request: {}'
                .format(exception), exc_info=1)

        except RequestParseError as exception:
            logging.error(
                'Service error while parsing request: {}'
                .format(exception), exc_info=1)

        else:
            logging.debug('Service received payload: {}'.format(payload))

        if response:
            self.send(response)
        else:
            self.send('')
238044
def _method_response_handler(self, response: Dict[str, Any]):
        
        code = response.get("CODE")
        if code in (200, 300):
            self._result_handler(response)
        else:
            asyncio.ensure_future(self._gen_result_handler(response))
57492
def handle(self, event):
        
        callback = getattr(self, 'on_{event}'.format(event=event.event), None)
        callback(event)
1169181
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $rootRequest = new RootRequest($request);
        return $handler->handle($rootRequest);
    }
903781
public function exec(): void
    {
        if (Application::route()->isAjax()) {
            // if is ajax
            $this->handleExceptionInAjax($this->e);
        } else {
            // normal request
            $this->handleExceptionInNormalRequest($this->e);
        }
    }
202357
def execute(self, method, path, **kwargs):
        

        url = "{}{}".format(self.host, path)
        kwargs.update(self._client_kwargs)
        response = requests.request(
            method,
            url,
            headers={"Authorization": "Bearer {}".format(self.api_key)},
            **kwargs)
        return response
1037678
def processRequest(self, arg, **kw):
        
        if self.debug:
            log.msg('===>PROCESS RESPONSE: %s' %str(arg), debug=1)

        if arg is None:
            return

        for h in self.handlers:
            arg = h.processRequest(arg, **kw)
            
        s = str(arg)
        if self.debug:
            log.msg(s, debug=1)

        return s
418593
public void handle(String pathInContext,
                       String pathParams,
                       HttpRequest request,
                       HttpResponse response)
        throws HttpException, IOException
    {
        log.debug("Not Found");
        String method=request.getMethod();
        
        // Not found  requests.
        if (method.equals(HttpRequest.__GET)    ||
            method.equals(HttpRequest.__HEAD)   ||
            method.equals(HttpRequest.__POST)   ||
            method.equals(HttpRequest.__PUT)    ||
            method.equals(HttpRequest.__DELETE) ||
            method.equals(HttpRequest.__MOVE)   )
        {
            response.sendError(HttpResponse.__404_Not_Found,
                               request.getPath()+" Not Found");
        }
        
        else if (method.equals(HttpRequest.__OPTIONS))
        {
            // Handle OPTIONS request for entire server
            if ("*".equals(request.getPath()))
            {
                // 9.2
                response.setIntField(HttpFields.__ContentLength,0);
                response.setField(HttpFields.__Allow,
                                  "GET, HEAD, POST, PUT, DELETE, MOVE, OPTIONS, TRACE");
                response.commit();
            }
            else
                response.sendError(HttpResponse.__404_Not_Found);
        }
        else if (method.equals(HttpRequest.__TRACE))
        {
            handleTrace(request,response);
        }
        else
        {
            // Unknown METHOD
            response.setField(HttpFields.__Allow,
                              "GET, HEAD, POST, PUT, DELETE, MOVE, OPTIONS, TRACE");
            response.sendError(HttpResponse.__405_Method_Not_Allowed);
        }
    }