From 41b1f649bf63e3663fcf3d4a678fef37688e32b7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Nov 2016 23:44:58 +0100 Subject: cmdline-docs: more options converted over --- docs/cmdline-opts/data.d | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docs/cmdline-opts/data.d (limited to 'docs/cmdline-opts/data.d') diff --git a/docs/cmdline-opts/data.d b/docs/cmdline-opts/data.d new file mode 100644 index 000000000..353b41f21 --- /dev/null +++ b/docs/cmdline-opts/data.d @@ -0,0 +1,30 @@ +Long: data +Short: d +Arg: +Help: HTTP POST data +Protocols: HTTP +See-also: data-binary data-urlencode data-raw +Mutexed: form head upload +--- +Sends the specified data in a POST request to the HTTP server, in the same way +that a browser does when a user has filled in an HTML form and presses the +submit button. This will cause curl to pass the data to the server using the +content-type application/x-www-form-urlencoded. Compare to --form. + +--data-raw is almost the same but does not have a special interpretation of +the @ character. To post data purely binary, you should instead use the +--data-binary option. To URL-encode the value of a form field you may use +--data-urlencode. + +If any of these options is used more than once on the same command line, the +data pieces specified will be merged together with a separating +&-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post +chunk that looks like \&'name=daniel&skill=lousy'. + +If you start the data with the letter @, the rest should be a file name to +read the data from, or - if you want curl to read the data from +stdin. Multiple files can also be specified. Posting data from a file named +'foobar' would thus be done with \fI--data\fP @foobar. When --data is told to +read from a file like that, carriage returns and newlines will be stripped +out. If you don't want the @ character to have a special interpretation use +--data-raw instead. -- cgit v1.2.3