#NEWLINE# def add_request( self , method , relative_url , headers , body , source_ip , module_name = None , version = None , instance_id = None , fake_login = False ) : #NEWLINE# #INDENT# 'Process an HTTP request.\n\n    Args:\n      method: A str containing the HTTP method of the request.\n      relative_url: A str containing path and query string of the request.\n      headers: A list of (key, value) tuples where key and value are both str.\n      body: A str containing the request body.\n      source_ip: The source ip address for the request.\n      module_name: An optional str containing the module name to service this\n          request. If unset, the request will be dispatched according to the\n          host header and relative_url.\n      version: An optional str containing the version to service this request.\n          If unset, the request will be dispatched according to the host header\n          and relative_url.\n      instance_id: An optional str containing the instance_id of the instance to\n          service this request. If unset, the request will be dispatched\n          according to the host header and relative_url and, if applicable, the\n          load-balancing for the module and version.\n      fake_login: A bool indicating whether login checks should be bypassed,\n          i.e. "login: required" should be ignored for this request.\n\n    Returns:\n      A request_info.ResponseTuple containing the response information for the\n      HTTP request.\n    ' #NEWLINE# if module_name : #NEWLINE# #INDENT# _module = self . _get_module_with_soft_routing ( module_name , version ) #NEWLINE# inst = ( _module . get_instance ( instance_id ) if instance_id else None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# headers_dict = wsgiref . headers . Headers ( headers ) #NEWLINE# ( _module , inst ) = self . _resolve_target ( headers_dict [ 'Host' ] , urlparse . urlsplit ( relative_url ) . path ) #NEWLINE# #UNINDENT# if inst : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# port = _module . get_instance_port ( inst . instance_id ) #NEWLINE# #UNINDENT# except request_info . NotSupportedWithAutoScalingError : #NEWLINE# #INDENT# port = _module . balanced_port #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# port = _module . balanced_port #NEWLINE# #UNINDENT# environ = _module . build_request_environ ( method , relative_url , headers , body , headers , port , fake_login = fake_login ) #NEWLINE# start_response = start_response_utils . CapturingStartResponse ( ) #NEWLINE# response = self . _handle_request ( environ , start_response , _module , inst ) #NEWLINE# merged = start_response . merged_response ( response ) #NEWLINE# return request_info . ResponseTuple ( start_response . status , start_response . response_headers , merged )