#NEWLINE# def new_request( params = None , body = None ) : #NEWLINE# #INDENT# environ = { #NEWLINE# #INDENT# 'wsgi.input' : StringIO ( '' ) , #NEWLINE# #UNINDENT# } #NEWLINE# if ( params is not None ) : #NEWLINE# #INDENT# environ [ 'QUERY_STRING' ] = urllib . urlencode ( params ) #NEWLINE# #UNINDENT# if ( body is not None ) : #NEWLINE# #INDENT# environ [ 'wsgi.input' ] = StringIO ( body ) #NEWLINE# environ [ 'CONTENT_LENGTH' ] = len ( body ) #NEWLINE# #UNINDENT# return bottle . Request ( environ = environ )