xref: /curl/docs/cmdline-opts/dump-header.md (revision b4f7ec71)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: dump-header
5Short: D
6Arg: <filename>
7Help: Write the received headers to <filename>
8Protocols: HTTP FTP
9Category: http ftp
10Added: 5.7
11Multi: single
12See-also:
13  - output
14Example:
15  - --dump-header store.txt $URL
16  - --dump-header - $URL -o save
17---
18
19# `--dump-header`
20
21Write the received protocol headers to the specified file. If no headers are
22received, the use of this option creates an empty file. Specify `-` as
23filename (a single minus) to have it written to stdout.
24
25Starting in curl 8.10.0, specify `%` (a single percent sign) as filename
26writes the output to stderr.
27
28When used in FTP, the FTP server response lines are considered being "headers"
29and thus are saved there.
30
31Starting in curl 8.11.0, using the --create-dirs option can also create
32missing directory components for the path provided in --dump-header.
33
34Having multiple transfers in one set of operations (i.e. the URLs in one
35--next clause), appends them to the same file, separated by a blank line.
36