blob: e9adc4563335e0115f9353f53b01a0423f5c970c [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: data-urlencode
4Arg: <data>
5Help: HTTP POST data URL encoded
6Protocols: HTTP
7See-also: data data-raw
8Added: 7.18.0
9Category: http post upload
10Example: --data-urlencode name=val $URL
11Example: --data-urlencode =encodethis $URL
12Example: --data-urlencode name@file $URL
13Example: --data-urlencode @fileonly $URL
14Multi: append
15---
16This posts data, similar to the other --data options with the exception
17that this performs URL-encoding.
18
19To be CGI-compliant, the <data> part should begin with a *name* followed
20by a separator and a content specification. The <data> part can be passed to
21curl using one of the following syntaxes:
22.RS
23.IP "content"
24This will make curl URL-encode the content and pass that on. Just be careful
25so that the content does not contain any = or @ symbols, as that will then make
26the syntax match one of the other cases below!
27.IP "=content"
28This will make curl URL-encode the content and pass that on. The preceding =
29symbol is not included in the data.
30.IP "name=content"
31This will make curl URL-encode the content part and pass that on. Note that
32the name part is expected to be URL-encoded already.
33.IP "@filename"
34This will make curl load data from the given file (including any newlines),
35URL-encode that data and pass it on in the POST.
36.IP "name@filename"
37This will make curl load data from the given file (including any newlines),
38URL-encode that data and pass it on in the POST. The name part gets an equal
39sign appended, resulting in *name=urlencoded-file-content*. Note that the
40name is expected to be URL-encoded already.
41.RE