def HandleRequest(environ, handler_name, url, post_data, application_root,
                  python_lib, import_hook=None):
  try:
    error = logservice.LogsBuffer()
    request_environment.current_request.Init(error, environ)
    url = urlparse.urlsplit(url)
    environ.update(CgiDictFromParsedUrl(url))
    if post_data:









      environ['CONTENT_LENGTH'] = str(len(post_data))
      if 'HTTP_CONTENT_TYPE' in environ:
        environ['CONTENT_TYPE'] = environ['HTTP_CONTENT_TYPE']
      else:
        environ['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
    post_data = cStringIO.StringIO(post_data)

    if '/' in handler_name or handler_name.endswith('.py'):
      response = cgi.HandleRequest(environ, handler_name, url, post_data, error,
                                   application_root, python_lib, import_hook)
    else:
      response = wsgi.HandleRequest(environ, handler_name, url, post_data,
                                    error)
    response['logs'] = error.parse_logs()
    return response
  finally:
    request_environment.current_request.Clear()
Handles a single request.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/runtime/runtime.py/HandleRequest