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.74k stars 3.68k forks source link

Improve streaming heuristics for GraphQL live queries #1455

Open GauBen opened 1 year ago

GauBen commented 1 year ago

Hey there, I noticed that the stream detection heuristics can be improved to support graphql live queries.

The following headers are used together to stream the response:

HTTP/1.1 200 OK
Date: Sat, 17 Dec 2022 17:03:00 GMT
access-control-allow-origin: *
connection: keep-alive
content-type: multipart/mixed; boundary="-"
transfer-encoding: chunked

Relevant lines: https://github.com/httpie/httpie/blob/621042a0486ceb3afaf47a013c4f2eee4edc1a1d/httpie/output/writer.py#L164-L170