Package com.google.appengine.api.urlfetch

Examples of com.google.appengine.api.urlfetch.MockHttpResponse.addHeader()


   
    @Test
    public void testReadResponseHeaders() throws Exception {
        GHttpEndpoint endpoint = createEndpoint("ghttp://somewhere.com:9090/path");
        MockHttpResponse response = new MockHttpResponse(200);
        response.addHeader("test", "abc");
        response.addHeader("content-type", "text/plain");
        binding.readResponseHeaders(endpoint, exchange, response);
        assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
        assertEquals("abc", exchange.getOut().getHeader("test"));
        assertEquals("text/plain", exchange.getOut().getHeader("content-type"));
View Full Code Here


    @Test
    public void testReadResponseHeaders() throws Exception {
        GHttpEndpoint endpoint = createEndpoint("ghttp://somewhere.com:9090/path");
        MockHttpResponse response = new MockHttpResponse(200);
        response.addHeader("test", "abc");
        response.addHeader("content-type", "text/plain");
        binding.readResponseHeaders(endpoint, exchange, response);
        assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
        assertEquals("abc", exchange.getOut().getHeader("test"));
        assertEquals("text/plain", exchange.getOut().getHeader("content-type"));
    }
View Full Code Here

    }

    public HTTPResponse fetch(HTTPRequest request) throws IOException {
        MockHttpResponse response = new MockHttpResponse(200);
        response.setContent(request.getPayload());
        response.addHeader("testUrl", request.getURL().toString());
        response.addHeader("testQuery", request.getURL().getQuery());
        response.addHeader("testMethod", request.getMethod().toString());
        for (HTTPHeader header : request.getHeaders()) {
            response.addHeader(header.getName(), header.getValue());
        }
View Full Code Here

    public HTTPResponse fetch(HTTPRequest request) throws IOException {
        MockHttpResponse response = new MockHttpResponse(200);
        response.setContent(request.getPayload());
        response.addHeader("testUrl", request.getURL().toString());
        response.addHeader("testQuery", request.getURL().getQuery());
        response.addHeader("testMethod", request.getMethod().toString());
        for (HTTPHeader header : request.getHeaders()) {
            response.addHeader(header.getName(), header.getValue());
        }
        return response;
View Full Code Here

    public HTTPResponse fetch(HTTPRequest request) throws IOException {
        MockHttpResponse response = new MockHttpResponse(200);
        response.setContent(request.getPayload());
        response.addHeader("testUrl", request.getURL().toString());
        response.addHeader("testQuery", request.getURL().getQuery());
        response.addHeader("testMethod", request.getMethod().toString());
        for (HTTPHeader header : request.getHeaders()) {
            response.addHeader(header.getName(), header.getValue());
        }
        return response;
    }
View Full Code Here

        response.setContent(request.getPayload());
        response.addHeader("testUrl", request.getURL().toString());
        response.addHeader("testQuery", request.getURL().getQuery());
        response.addHeader("testMethod", request.getMethod().toString());
        for (HTTPHeader header : request.getHeaders()) {
            response.addHeader(header.getName(), header.getValue());
        }
        return response;
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.