data-urlencode.d 1.6 KB

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