#NEWLINE# def getresponse( self ) : #NEWLINE# #INDENT# if ( self . port and ( self . port != self . default_port ) ) : #NEWLINE# #INDENT# host = ( '%s:%s' % ( self . host , self . port ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# host = self . host #NEWLINE# #UNINDENT# if ( not self . _url . startswith ( self . protocol ) ) : #NEWLINE# #INDENT# url = ( '%s://%s%s' % ( self . protocol , host , self . _url ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url = self . _url #NEWLINE# #UNINDENT# headers = dict ( self . headers ) #NEWLINE# try : #NEWLINE# #INDENT# method = self . _method_map [ self . _method . upper ( ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise ValueError ( ( '%r is an unrecognized HTTP method' % self . _method ) ) #NEWLINE# #UNINDENT# response = self . _fetch ( url , self . _body , method , headers , self . _allow_truncated , self . _follow_redirects ) #NEWLINE# return HTTPResponse ( response )