curl-curl/docs/cmdline-opts/location-trusted.md
Daniel Stenberg 13cbabf05f
curl: add --follow
Makes curl follow redirects an act on the response code and change a
custom method accordingly, contrary to --location.

Potential future command line to send QUERY and following a redirect
according to the status code:

    curl -d "request-body" -X QUERY --follow https://example.com

add test 794,796,797

Assisted-by: Daniel Böhmer <post@daniel-boehmer.de>

Closes #16543
2025-08-04 17:12:14 +02:00

850 B

c SPDX-License-Identifier Long Help Protocols Category Added Multi See-also Example
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl location-trusted As --location, but send secrets to other hosts HTTP http auth 7.10.4 boolean
user
follow
--location-trusted -u user:password $URL
--location-trusted -H "Cookie
session=abc" $URL

--location-trusted

Instruct curl to follow HTTP redirects like --location, but permit curl to send credentials and other secrets along to other hosts than the initial one.

This may or may not introduce a security breach if the site redirects you to a site to which you send this sensitive data to. Another host means that one or more of hostname, protocol scheme or port number changed.

This option also allows curl to pass long cookies set explicitly with --header.