curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Server Sent Events and gzip

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 28 Nov 2023 14:08:28 +0100 (CET)

On Tue, 28 Nov 2023, Stefan Lauer via curl-library wrote:

> When I use the curl command line interface with:
> curl -v --compressed -i „[URL]" -H "accept: text/event-stream" -H "Accept-Encoding: gzip“

I would recommend *not* setting that custom Accept-Encoding header. The
--compressed option sets the header itself to the value it deems best, which
may or may not be exactly "gzip". As it depends on what capabilities your
libcurl has.

The same goes for when using libcurl. It is better to let it use the methods
it supports rather than overriding it with a specific method.

> curl.http_transfer_decoding(true).unwrap();

Transfer encoding is rarely used (by anyone, anywhere). I would try without it
first to see if it makes anything different.

> If I use http-Version 1.1 I get an error: Error { description: "Transferred
> a partial file", code: 18, extra: Some("transfer closed with outstanding
> read data remaining") }

I would set verbose output to figure out what's going on more exactly over the
wire. This sounds as if the transfer is somehow aborted before the entire body
has been received.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-11-28