data-urlencode.d 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. c: Copyright (C) 1998 - 2022, 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. ---
  15. This posts data, similar to the other --data options with the exception
  16. that this performs URL-encoding.
  17. To be CGI-compliant, the <data> part should begin with a *name* followed
  18. by a separator and a content specification. The <data> part can be passed to
  19. curl using one of the following syntaxes:
  20. .RS
  21. .IP "content"
  22. This will make curl URL-encode the content and pass that on. Just be careful
  23. so that the content does not contain any = or @ symbols, as that will then make
  24. the syntax match one of the other cases below!
  25. .IP "=content"
  26. This will make curl URL-encode the content and pass that on. The preceding =
  27. symbol is not included in the data.
  28. .IP "name=content"
  29. This will make curl URL-encode the content part and pass that on. Note that
  30. the name part is expected to be URL-encoded already.
  31. .IP "@filename"
  32. This will make curl load data from the given file (including any newlines),
  33. URL-encode that data and pass it on in the POST.
  34. .IP "name@filename"
  35. This will make curl load data from the given file (including any newlines),
  36. URL-encode that data and pass it on in the POST. The name part gets an equal
  37. sign appended, resulting in *name=urlencoded-file-content*. Note that the
  38. name is expected to be URL-encoded already.
  39. .RE