request.d 1.6 KB

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