#NEWLINE# def __addRequestArguments( self , request , allargs ) : #NEWLINE# #INDENT# 'Parses the request form arguments OR JSON document root elements to build the list of arguments to a method' #NEWLINE# requestargs = request . args #NEWLINE# if ( ( request . method == Http . PUT ) and ( HttpHeader . CONTENT_TYPE in request . received_headers . keys ( ) ) and ( request . received_headers [ HttpHeader . CONTENT_TYPE ] == MediaType . APPLICATION_FORM_URLENCODED ) ) : #NEWLINE# #INDENT# requestargs = parse_qs ( request . data , 1 ) #NEWLINE# #UNINDENT# if ( len ( requestargs . keys ( ) ) > 0 ) : #NEWLINE# #INDENT# for arg in requestargs . keys ( ) : #NEWLINE# #INDENT# safeDictUpdate ( allargs , arg , requestargs [ arg ] [ 0 ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( request , 'json' ) : #NEWLINE# #INDENT# for key in request . json . keys ( ) : #NEWLINE# #INDENT# safeDictUpdate ( allargs , key , request . json [ key ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( request , 'yaml' ) : #NEWLINE# #INDENT# for key in request . yaml . keys ( ) : #NEWLINE# #INDENT# safeDictUpdate ( allargs , key , request . yaml [ key ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( request , 'xml' ) : #NEWLINE# #INDENT# for key in request . xml . attrib : #NEWLINE# #INDENT# safeDictUpdate ( requestargs , key , request . xml . attrib [ key ] ) #NEWLINE# #UNINDENT# for el in request . xml . findall ( '*' ) : #NEWLINE# #INDENT# safeDictUpdate ( allargs , el . tag , el . text )