request.d 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. SPDX-License-Identifier: curl
  3. Long: request
  4. Short: X
  5. Arg: <method>
  6. Help: Specify request method to use
  7. Category: connection
  8. Example: -X "DELETE" $URL
  9. Example: -X NLST ftp://example.com/
  10. Added: 6.0
  11. See-also: request-target
  12. Multi: single
  13. ---
  14. (HTTP) Specifies a custom request method to use when communicating with the
  15. HTTP server. The specified request method will be used instead of the method
  16. otherwise used (which defaults to *GET*). Read the HTTP 1.1 specification for
  17. details and explanations. Common additional HTTP requests include *PUT* and
  18. *DELETE*, but related technologies like WebDAV offers *PROPFIND*, *COPY*,
  19. *MOVE* and more.
  20. Normally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and
  21. *PUT* requests are rather invoked by using dedicated command line options.
  22. This option only changes the actual word used in the HTTP request, it does not
  23. alter the way curl behaves. So for example if you want to make a proper HEAD
  24. request, using -X HEAD will not suffice. You need to use the --head option.
  25. The method string you set with --request will be used for all requests, which
  26. if you for example use --location may cause unintended side-effects when curl
  27. does not change request method according to the HTTP 30x response codes - and
  28. similar.
  29. (FTP)
  30. Specifies a custom FTP command to use instead of *LIST* when doing file lists
  31. with FTP.
  32. (POP3)
  33. Specifies a custom POP3 command to use instead of *LIST* or *RETR*.
  34. (Added in 7.26.0)
  35. (IMAP)
  36. Specifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0)
  37. (SMTP)
  38. Specifies a custom SMTP command to use instead of *HELP* or *VRFY*. (Added in 7.34.0)