#NEWLINE# def put( self , path , payload , callback = None ) : #NEWLINE# #INDENT# request = Request ( ) #NEWLINE# request . destination = self . server #NEWLINE# request . code = defines . Codes . PUT . number #NEWLINE# request . uri_path = path #NEWLINE# request . payload = payload #NEWLINE# if ( callback is not None ) : #NEWLINE# #INDENT# thread = threading . Thread ( target = self . _thread_body , args = ( request , callback ) ) #NEWLINE# thread . start ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . protocol . send_message ( request ) #NEWLINE# response = self . queue . get ( block = True ) #NEWLINE# return response