xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | c: Copyright (C) 1998 - 2022, 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, MOVE and |
| 19 | more. |
| 20 | |
| 21 | Normally you do not need this option. All sorts of GET, HEAD, POST and PUT |
| 22 | requests are rather invoked by using dedicated command line options. |
| 23 | |
| 24 | This option only changes the actual word used in the HTTP request, it does not |
| 25 | alter the way curl behaves. So for example if you want to make a proper HEAD |
| 26 | request, using -X HEAD will not suffice. You need to use the --head option. |
| 27 | |
| 28 | The method string you set with --request will be used for all requests, which |
| 29 | if you for example use --location may cause unintended side-effects when curl |
| 30 | does not change request method according to the HTTP 30x response codes - and |
| 31 | similar. |
| 32 | |
| 33 | (FTP) |
| 34 | Specifies a custom FTP command to use instead of LIST when doing file lists |
| 35 | with FTP. |
| 36 | |
| 37 | (POP3) |
| 38 | Specifies a custom POP3 command to use instead of LIST or RETR. |
| 39 | (Added in 7.26.0) |
| 40 | |
| 41 | (IMAP) |
| 42 | Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0) |
| 43 | |
| 44 | (SMTP) |
| 45 | Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0) |