On Sat, Apr 05, 2025 at 11:46:51AM +0200, Daniel Stenberg via curl-users wrote:
> If there is anyone around who uses --raw with a decent use case? I would not 
> mind learning how/why
> because I'm about to break it:

Debian codesearch shows a number of projects using it:
https://sourcegraph.com/search?q=context:global+/curl.*--raw%5B%5E-%5D/&patternType=keyword&sm=0

xrootd (in tests):
curl -v -L --raw -H "X-Transfer-Status: true" -H "TE: trailers" 
"${HOST}/$alphabetFilePath" --output - | tr -d '\r' > "$outputFilePath"

uwsgi (in examples):
# curl -D /dev/stdout -N --raw http://localhost:9090/

bashtop:
curl -m 4 --raw -r 0-5000 
https://raw.githubusercontent.com/aristocratos/bashtop/master/bashtop
curl -m 3 --raw 
https://raw.githubusercontent.com/aristocratos/bashtop/master/themes/index.txt
curl -m 3 --raw 
"https://raw.githubusercontent.com/aristocratos/bashtop/master/themes/${git_theme}";

Plus, many other hits via sourcegraph:
https://sourcegraph.com/search?q=context:global+/curl.*--raw%5B%5E-%5D/&patternType=keyword&sm=0

A few examples:
$ curl -i -0 --raw http://fretboard.tardate.com/status.csv
$ curl -v --raw --http2-prior-knowledge -X POST  -H "content-type: 
application/grpc" -H "TE: trailers" --data-binary @hello.mspack --output - 
http://localhost:8080/greeter.api.GreeterApi/hello
curl -s --raw 
https://raw.githubusercontent.com/bcgov/DITP-DevOps/main/code/snippets/getDockerHost
curl -s --raw -L "${kf_url}"


Fortunately, the use of --raw in the vast majority of these examples looks on
first glance to be completely wrong.  It looks like people haven't read the
documentation and assume that --raw is like jq's -r (raw strings) and are
fortunate that the servers aren't actually using chunked encoding or gzip
compression so the results just work. Some other examples appear to be for
debugging purposes where --raw might show more information, but are likely to
once again, be simply unneeded.

Interestingly, a lot of these --raw uses are also using the equally unnecessary
and potentially harmful -X as well showing how people are simply not
understanding these options. Maybe you need another blog post like
https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/ but for
--raw.

Dan
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to