I'm pretty new to Java and REST/REST assured. I'm trying to create a POST Request with "Transfer-Encoding: chunked" set (via a Header) but I get the exception “org.apache.http.ProtocolException: Transfer-encoding header already present”.
The code I'm using is similar to the following ..... @Test ...... given() .headers(uses a method that sets the required headers, including "Transfer-encoding") .body("testdata".getBytes()) .contentType(MediaType.APPLICATION_OCTET_STREAM) .log().all() .expect() .statusCode(HttpStatus.SC_OK) .post();
but I get the exception "org.apache.http.ProtocolException: Transfer-encoding header already present”.
Does anyone have an idea why i'm getting the exception / how i can resolve it?? Thanks in advance.