users@glassfish.java.net

Re: Requests with Content-Encoding: gzip

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 22 Mar 2010 13:05:36 +0100

On Mar 22, 2010, at 12:54 PM, glassfish_at_javadesktop.org wrote:

> I have created a simple RESTful web service that accept XML
> requests. For testing I can successfully post an XML file from the
> command line with
>
> curl --header 'Content-Type: application/xml' -d'@request.xml' http://localhost/ws/rest/upload
>
> Now I'm trying to send a gzip-compressed request:
>
> curl --header 'Content-Type: application/xml' --header 'Content-
> Encoding: gzip' -d'@request.xml.gz' http://localhost/ws/rest/upload
>
> However Glassfish rejects it with 400: Bad Request. What is wrong?
>

Are you using the JAX-RS or Servlet API?

If the former see:

https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.html

Paul.