xref: /curl/docs/cmdline-opts/data-binary.md (revision e7219c2b)
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. Data
22is posted in a similar manner as --data does, except that newlines and
23carriage returns are preserved and conversions are never done.
24
25Like --data the default content-type sent to the server is
26application/x-www-form-urlencoded. If you want the data to be treated as
27arbitrary binary data by the server then set the content-type to octet-stream:
28-H "Content-Type: application/octet-stream".
29
30If this option is used several times, the ones following the first append
31data as described in --data.
32