My team and I have a Tomcat server running a Restfull webservice, implemented using RestEasy:
@POST
@GZIP
@Path("/capture")
@Consumes(MediaType.APPLICATION_JSON)
Response RecieveData(@GZIP RecievingData recievingData);
We need to make compressed post to this service. The problem is we are not finding an implementation that works.
- We tried using interceptors: https://hc.apache.org/httpcomponents-client-4.2.x/httpclient/examples/org/apache/http/examples/client/ClientGZipContentCompression.java. But we were unable to capture the POST request Body and compress it.
We tried using the RestEasy client but it doesn´t seems to be compreesing the body of the Post Request: www.posttestserver.com/data/2016/01/06/15.33.391016591335
Finally we tried a customized class: https://gist.github.com/takumakei/913067. But we got a 400 error on the request:
HTTP/1.1 400 Bad Request [Content-Encoding: gzip, Content-Type: text/html; charset=UTF-8, Date: Thu, 07 Jan 2016 10:07:05 GMT, Server: Apache-Coyote/1.1, Content-Length: 66, Connection: keep-alive]
We are out of ideas and this supose to be a simple function for an HTTP Client. Any ideas?
OBS: Here is the RestEasy Proxy:
@POST
@GZIP
@Consumes(MediaType.APPLICATION_JSON)
public Response saveData(@GZIP RecievingData customer);
EDIT: Got some changes in the Firewall and the 3rd method changed to an error 400.