xref: /curl/docs/cmdline-opts/data-binary.md (revision bfa939d0)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: data-binary
5Arg: <data>
6Help: HTTP POST binary data
7Protocols: HTTP
8Category: http post upload
9Added: 7.2
10Multi: append
11See-also:
12  - data-ascii
13Example:
14  - --data-binary @filename $URL
15---
16
17# `--data-binary`
18
19Post data exactly as specified with no extra processing whatsoever.
20
21If you start the data with the letter @, the rest should be a filename.
22`@-` makes curl read the data from stdin. Data is posted in a similar
23manner as --data does, except that newlines and carriage returns are
24preserved and conversions are never done.
25
26Like --data the default content-type sent to the server is
27application/x-www-form-urlencoded. If you want the data to be treated as
28arbitrary binary data by the server then set the content-type to octet-stream:
29-H "Content-Type: application/octet-stream".
30
31If this option is used several times, the ones following the first append
32data as described in --data.
33