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)
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')], '')
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')], '')
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")], "")