2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2016-11-16 06:44:58 +08:00
|
|
|
Long: data-binary
|
|
|
|
Arg: <data>
|
|
|
|
Help: HTTP POST binary data
|
|
|
|
Protocols: HTTP
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: http post upload
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: --data-binary @filename $URL
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 7.2
|
2021-11-15 22:58:20 +08:00
|
|
|
See-also: data-ascii
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: append
|
2016-11-16 06:44:58 +08:00
|
|
|
---
|
|
|
|
This posts data exactly as specified with no extra processing whatsoever.
|
|
|
|
|
2021-11-26 15:46:59 +08:00
|
|
|
If you start the data with the letter @, the rest should be a filename. Data
|
2016-11-16 06:44:58 +08:00
|
|
|
is posted in a similar manner as --data does, except that newlines and
|
|
|
|
carriage returns are preserved and conversions are never done.
|
|
|
|
|
2018-10-03 09:55:57 +08:00
|
|
|
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".
|
|
|
|
|
2023-09-08 20:32:29 +08:00
|
|
|
If this option is used several times, the ones following the first append
|
2016-11-16 06:44:58 +08:00
|
|
|
data as described in --data.
|