aboutsummaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/data-binary.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/cmdline-opts/data-binary.md')
-rw-r--r--docs/cmdline-opts/data-binary.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/cmdline-opts/data-binary.md b/docs/cmdline-opts/data-binary.md
new file mode 100644
index 000000000..3d563fbdd
--- /dev/null
+++ b/docs/cmdline-opts/data-binary.md
@@ -0,0 +1,31 @@
+---
+c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+SPDX-License-Identifier: curl
+Long: data-binary
+Arg: <data>
+Help: HTTP POST binary data
+Protocols: HTTP
+Category: http post upload
+Added: 7.2
+Multi: append
+See-also:
+ - data-ascii
+Example:
+ - --data-binary @filename $URL
+---
+
+# `--data-binary`
+
+This posts data exactly as specified with no extra processing whatsoever.
+
+If you start the data with the letter @, the rest should be a filename. Data
+is posted in a similar manner as --data does, except that newlines and
+carriage returns are preserved and conversions are never done.
+
+Like --data the default content-type sent to the server is
+application/x-www-form-urlencoded. If you want the data to be treated as
+arbitrary binary data by the server then set the content-type to octet-stream:
+-H "Content-Type: application/octet-stream".
+
+If this option is used several times, the ones following the first append
+data as described in --data.