data-urlencode.d 1.5 KB

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