def create_handler(handler_class, method, url, headers={}, input_body='<STR_LIT>'):
environ = {<EOL>'<STR_LIT>': StringIO.StringIO(input_body),<EOL>'<STR_LIT>': sys.stderr,<EOL>'<STR_LIT>': method,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': url,<EOL>'<STR_LIT>': headers.pop('<STR_LIT>', '<STR_LIT>'),<EOL>'<STR_LIT>': headers.pop('<STR_LIT>', '<STR_LIT>'),<EOL>}<EOL>if method == '<STR_LIT:GET>':<EOL><INDENT>environ['<STR_LIT>'], environ['<STR_LIT>'] = (<EOL>(url.split('<STR_LIT:?>', <NUM_LIT:1>) + ['<STR_LIT>'])[:<NUM_LIT:2>])<EOL><DEDENT>for name, value in headers.iteritems():<EOL><INDENT>fixed_name = name.replace('<STR_LIT:->', '<STR_LIT:_>').upper()<EOL>environ['<STR_LIT>' + fixed_name] = value<EOL><DEDENT>handler = handler_class()<EOL>request = webapp.Request(environ)<EOL>response = webapp.Response()<EOL>handler.initialize(request, response)<EOL>return handler<EOL>
Creates a webapp.RequestHandler instance and request/response objects.