0

I want to find about the HTTP 1.1 compression of the site I am talking to. I need to do it programmatically in Java.

What I want to find out is: Does the server support compression for incoming requests? Does the server support compression for responses?

Thanks in advance.

er4z0r
  • 4,711
  • 8
  • 42
  • 62

1 Answers1

0

There isn't a general case answer for this. The HTTP/1.1 spec lets the client tell the server that it accepts compressed responses, but from the response you can't tell a difference from a server that can't compress responses and a server that just decided not to compress your single response.

David
  • 34,223
  • 3
  • 62
  • 80
  • Hmm. And I cannot "force" the server to give me compressed data? Like saying "hey, I only accept gzip and nothing else!" and then see if I get compressed data or an error-code. – er4z0r Nov 03 '09 at 20:27
  • Client's can send an "accept" header that says they support GZip or deflate compression, but it's always assumed that they support non-compressed data as well. – David Nov 04 '09 at 16:34
  • OK. I'll try that. And how do I evaluate if the actual response was compressed? Evaluate Content-Encoding? – er4z0r Nov 05 '09 at 14:36