#NEWLINE# def createRequest( self , operation , request , outgoingData = None ) : #NEWLINE# #INDENT# '\n        This method is called when a new request is sent;\n        it must return a reply object to work with.\n        ' #NEWLINE# start_time = datetime . utcnow ( ) #NEWLINE# self . _clear_proxy ( ) #NEWLINE# ( request , req_id ) = self . _wrap_request ( request ) #NEWLINE# self . _handle_custom_headers ( request ) #NEWLINE# self . _handle_request_cookies ( request ) #NEWLINE# self . _run_webpage_callbacks ( request , 'on_request' , request , operation , outgoingData ) #NEWLINE# self . _handle_custom_proxies ( request ) #NEWLINE# har = self . _get_har ( request ) #NEWLINE# if ( har is not None ) : #NEWLINE# #INDENT# har . store_new_request ( req_id = req_id , start_time = start_time , operation = operation , request = request , outgoingData = outgoingData ) #NEWLINE# #UNINDENT# reply = super ( ProxiedQNetworkAccessManager , self ) . createRequest ( operation , request , outgoingData ) #NEWLINE# if hasattr ( request , 'timeout' ) : #NEWLINE# #INDENT# timeout = ( request . timeout * 1000 ) #NEWLINE# if timeout : #NEWLINE# #INDENT# self . _set_reply_timeout ( reply , timeout ) #NEWLINE# #UNINDENT# #UNINDENT# if ( har is not None ) : #NEWLINE# #INDENT# har . store_new_reply ( req_id , reply ) #NEWLINE# #UNINDENT# reply . error . connect ( timeout . _on_reply_error ) #NEWLINE# reply . finished . connect ( self . _on_reply_finished ) #NEWLINE# reply . metaDataChanged . connect ( self . _on_reply_headers ) #NEWLINE# reply . downloadProgress . connect ( self . _on_reply_download_progress ) #NEWLINE# return reply