@Test public void shouldReturnCorrectResponse() throws Exception { Robolectric.addPendingHttpResponse(666, "it's all cool"); Http.Response response = http.get("www.example.com", new HashMap<String, String>(), null, null); assertThat(fromStream(response.getResponseBody()), equalTo("it's all cool")); assertThat(response.getStatusCode(), equalTo(666)); }
public Response get(String url, Map<String, String> headers, String username, String password) throws IOException, URISyntaxException { URI uri = new URI(url); return makeRequest(headers, username, password, new HttpGet(uri), uri.getHost()); }
Http { public Response get(String url, Map<String, String> headers, String username, String password) throws IOException, URISyntaxException { URI uri = new URI(url); return makeRequest(headers, username, password, new HttpGet(uri), uri.getHost()); } }
Http { public Response get(String url, Map<String, String> headers, String username, String password) throws IOException, URISyntaxException { URI uri = new URI(url); return makeRequest(headers, username, password, new HttpGet(uri), uri.getHost()); }  }
Http { public Response get(String url, Map<String, String> headers, String username, String password) throws IOException, URISyntaxException { URI uri = new URI(url); return makeRequest(headers, username, password, new HttpGet(uri), uri.getHost()); }  Response get(String url, Map<String, String> headers, String username, String password); Response post(String url, Map<String, String> headers, String postBody, String username, String password); }
Http { public Response get(String url, Map<String, String> headers, String username, String password) throws IOException, URISyntaxException { URI uri = new URI(url); return makeRequest(headers, username, password, new HttpGet(uri), uri.getHost()); }  Response get(String url, Map<String, String> headers, String username, String password); Response post(String url, Map<String, String> headers, String postBody, String username, String password);  }