@Test public void testCopyRequest() throws Exception { HTTPRequest request = new HTTPRequest(new URL("http: request.setHeader(new HTTPHeader("k3", "v3")); HTTPRequest copy = URLFetchUtils.copyRequest(request); assertEquals("http: assertEquals(HTTPMethod.HEAD, copy.getMethod()); assertEquals(1, copy.getHeaders().size()); assertEquals("k3", copy.getHeaders().get(0).getName()); assertEquals("v3", copy.getHeaders().get(0).getValue()); }
static HTTPRequest copyRequest(HTTPRequest in) { HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions()); for (HTTPHeader h : in.getHeaders()) { out.addHeader(h); } out.setPayload(in.getPayload()); return out; }
URLFetchUtils { static HTTPRequest copyRequest(HTTPRequest in) { HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions()); for (HTTPHeader h : in.getHeaders()) { out.addHeader(h); } out.setPayload(in.getPayload()); return out; } }
URLFetchUtils { static HTTPRequest copyRequest(HTTPRequest in) { HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions()); for (HTTPHeader h : in.getHeaders()) { out.addHeader(h); } out.setPayload(in.getPayload()); return out; } private  URLFetchUtils(); }
URLFetchUtils { static HTTPRequest copyRequest(HTTPRequest in) { HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions()); for (HTTPHeader h : in.getHeaders()) { out.addHeader(h); } out.setPayload(in.getPayload()); return out; } private  URLFetchUtils();  }
URLFetchUtils { static HTTPRequest copyRequest(HTTPRequest in) { HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions()); for (HTTPHeader h : in.getHeaders()) { out.addHeader(h); } out.setPayload(in.getPayload()); return out; } private  URLFetchUtils();   }