@Test public void headersAndPostParams() throws Exception {

    MockHttpStack mockHttpStack = new MockHttpStack();
    final NetworkResponse fakeResponse = new NetworkResponse(200, "foobar".getBytes(), new Headers
            .Builder().add("requestheader", "foo").build(), 0);
    mockHttpStack.setResponseToReturn(fakeResponse);
    HttpNetwork httpNetwork = new HttpNetwork(mockHttpStack);
    Request<String> request = new Request<String>(Request.Method.GET, "http://foo") {
        @Override
        protected void deliverResponse(String response) {
        }
    };
    request.setNetworkRequest(new FormEncodingBuilder()
            .add("requestpost", "foo")
            .builder().setHeader("requestheader", "foo").build());
    httpNetwork.performRequest(request);
    assertEquals("foo", mockHttpStack.getLastHeaders().get("requestheader"));
    assertEquals("requestpost=foo", new String(mockHttpStack.getLastPostBody()));
}