httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
32.7k stars 3.67k forks source link

decompress compressed data #1511

Open CuteistFox opened 1 year ago

CuteistFox commented 1 year ago

Enhancement request

decompress compressed data (not just gzip)

checklist

MayukhSobo commented 1 year ago

Hi @Meow-purr I wanted to understand more about this issue as I was interested to work on this issue. Do you want the incoming request from a server to get decompressed and show or while sending the request, it needs to be decompressed? If the response is not decompressed, how does it look like currently using httpie when compressed data is sent from a http server?

CuteistFox commented 1 year ago

for a tarball of linux kernal `https https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-6.4-rc7.tar.gz HTTP/1.1 200 OK Connection: keep-alive Content-Disposition: inline; filename="linux-6.4-rc7.tar.gz" Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; script-src-attr 'unsafe-hashes' 'sha256-rQQdnklrOmulrf5mQ2YjUK7CGbu4ywAi21E8nGlJcDc'; img-src https: Content-Type: application/x-gzip; charset=UTF-8 Date: Thu, 22 Jun 2023 17:36:39 GMT ETag: "be10b9a5f6c20252039731efda7f268e57fb5dd3" Expires: Thu, 22 Jun 2023 18:36:04 GMT Last-Modified: Thu, 22 Jun 2023 17:36:04 GMT Referrer-Policy: same-origin Server: nginx Strict-Transport-Security: max-age=15768001 Transfer-Encoding: chunked X-Content-Type-Options: nosniff X-Frame-Options: DENY

+-----------------------------------------+ | NOTE: binary data not shown in terminal | +-----------------------------------------+

`

and i can loop it through zcat https https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-6.4-rc7.tar.gz | zcat and get something so large it would be spam if i posted it here which is the entire code of linux or

CuteistFox commented 1 year ago

tarball is not unarchived

CuteistFox commented 1 year ago

but just u=in text reprsentation

MayukhSobo commented 1 year ago

Can you please format your comments? It is actually hard to understand. From the looks of it, it seems that you need the file to display which was gzipped and sent during the request.

  1. Is the above assumption is true?
  2. Is there any specific scenario that you can explain where you need to display the downloaded file on the terminal. Because generally we download the file and use it normally.
  3. Do you want to download the file instead of displaying the contents?
  4. If no, then are you planning to display all the content like linux kenel on the terminal?
  5. Finally, Is there any other use cases apart from compressed file content display?
MayukhSobo commented 1 year ago

Can you please format your comments? It is actually hard to understand. From the looks of it, it seems that you need the file to display which was gzipped and sent during the request.

  1. Is the above assumption is true?
  2. Is there any specific scenario that you can explain where you need to display the downloaded file on the terminal. Because generally we download the file and use it normally.
  3. Do you want to download the file instead of displaying the contents?
  4. If no, then are you planning to display all the content like linux kenel on the terminal?
  5. Finally, Is there any other use cases apart from compressed file content display?
CuteistFox commented 1 year ago
  1. yes
  2. why not
  3. no
  4. yes
  5. yes
MayukhSobo commented 1 year ago

@Meow-purr Can you please elaborate the last point?

CuteistFox commented 1 year ago

simplicity of savibg fieles uncompressed

CuteistFox commented 1 year ago

without having a long stream of pipes or briefly having compressed data stored(even if in /tmp)