2
0

request.d 1.6 KB

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