[Biojava-l] Semantics of "Accept-Encoding" in HTTP

Thomas Down td2@sanger.ac.uk
Thu, 19 Jul 2001 12:33:36 +0100


On Wed, Jul 18, 2001 at 11:15:18PM +0100, David Huen wrote:
>
> To quote the IETF 2068,
> "If no Accept-encoding header is present in a request, the server MAY
> assume that the client will accept any content coding.  If an
> Accept-Encoding header is present, and if the server cannot send a
> response which is acceptable according to the Accept-Encoding header, then
> this server SHOULD send an error response with the 406 (Not Acceptable)
> status code."
> 
> It seems to me that I can't indicate the situation where I would like
> to have compression (for example gzip) but am prepared to accept unencoded
> responses.  If I use "Accept-Encoding: gzip" and it doesn't have it why is
> the 406 response recommended rather returning just unencoded data?  So a
> compression-incapable client should refuse to to service such a query
> rather than provide unencoded data?
> 
> Alternatively, if I don't use such an "Accept-Encoding", I am allegedly
> permitted to return any encoding?  It seems bizaare!  How can these
> semantics be right?  So as compression-capable DAS server getting a query
> from a client without such a property, I can send e.g. gzipped
> responses?
> 
> Where have I misunderstood this?  Surely the negotiation can't possibly be
> this bizaare?

I dont' have all the documents handy (I'm at BOSC...) but as
I recall, you can use something along the lines of:

  Accept-Encoding: gzip, plain

Which says that GZIP is thepreferred encoding, but plain
is also acceptable.  That seems to be the behaviour you
want?

If you've got access to the standards, could you check this
out?

   Thomas.