request.d 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. Change the method to use when starting the transfer.
  15. .RS
  16. .TP 15
  17. **HTTP**
  18. Specifies a custom request method to use when communicating with the HTTP
  19. server. The specified request method is used instead of the method otherwise
  20. used (which defaults to *GET*). Read the HTTP 1.1 specification for details
  21. and explanations. Common additional HTTP requests include *PUT* and *DELETE*,
  22. but related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and
  23. more.
  24. Normally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and
  25. *PUT* requests are rather invoked by using dedicated command line options.
  26. This option only changes the actual word used in the HTTP request, it does not
  27. alter the way curl behaves. So for example if you want to make a proper HEAD
  28. request, using -X HEAD does not suffice. You need to use the --head option.
  29. The method string you set with --request is used for all requests, which
  30. if you for example use --location may cause unintended side-effects when curl
  31. does not change request method according to the HTTP 30x response codes - and
  32. similar.
  33. .TP
  34. **FTP**
  35. Specifies a custom FTP command to use instead of *LIST* when doing file lists
  36. with FTP.
  37. .TP
  38. **POP3**
  39. Specifies a custom POP3 command to use instead of *LIST* or *RETR*.
  40. (Added in 7.26.0)
  41. .TP
  42. **IMAP**
  43. Specifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0)
  44. .TP
  45. **SMTP**
  46. Specifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0)
  47. .RE
  48. .IP