示例#1
0
    def handle_api_explorer_request(self, request, start_response):
        """Handler for requests to _ah/api/explorer.

    This calls start_response and returns the response body.

    Args:
      request: An ApiRequest, the request from the user.
      start_response: A function with semantics defined in PEP-333.

    Returns:
      A string containing the response body (which is empty, in this case).
    """
        base_url = 'http://%s:%s/_ah/api' % (request.server, request.port)
        redirect_url = self._API_EXPLORER_URL + base_url
        return util.send_wsgi_redirect_response(redirect_url, start_response)
示例#2
0
  def handle_api_explorer_request(self, request, start_response):
    """Handler for requests to _ah/api/explorer.

    This calls start_response and returns the response body.

    Args:
      request: An ApiRequest, the request from the user.
      start_response: A function with semantics defined in PEP-333.

    Returns:
      A string containing the response body (which is empty, in this case).
    """
    base_url = 'http://%s:%s/_ah/api' % (request.server, request.port)
    redirect_url = self._API_EXPLORER_URL + base_url
    return util.send_wsgi_redirect_response(redirect_url, start_response)
示例#3
0
文件: util_test.py 项目: girum11/hang
 def test_send_wsgi_redirect_response(self):
     response = util.send_wsgi_redirect_response('http://www.google.com',
                                                 self.start_response)
     self.assert_http_match(response, 302,
                            [('Location', 'http://www.google.com'),
                             ('Content-Length', '0')], '')
示例#4
0
 def test_send_wsgi_redirect_response(self):
   response = util.send_wsgi_redirect_response(
       'http://www.google.com', self.start_response)
   self.assert_http_match(response, 302,
                          [('Location', 'http://www.google.com'),
                           ('Content-Length', '0')], '')
示例#5
0
 def test_send_wsgi_redirect_response(self):
     response = util.send_wsgi_redirect_response("http://www.google.com", self.start_response)
     self.assert_http_match(response, 302, [("Location", "http://www.google.com"), ("Content-Length", "0")], "")