request.md (1940B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Long: request 5 Short: X 6 Arg: <method> 7 Help: Specify request method to use 8 Category: connection pop3 ftp imap smtp 9 Added: 6.0 10 Multi: single 11 See-also: 12 - request-target 13 Example: 14 - -X "DELETE" $URL 15 - -X NLST ftp://example.com/ 16 --- 17 18 # `--request` 19 20 Change the method to use when starting the transfer. 21 22 curl passes on the verbatim string you give it in the request without any 23 filter or other safe guards. That includes white space and control characters. 24 25 ## HTTP 26 Specifies a custom request method to use when communicating with the HTTP 27 server. The specified request method is used instead of the method otherwise 28 used (which defaults to *GET*). Read the HTTP 1.1 specification for details 29 and explanations. Common additional HTTP requests include *PUT* and *DELETE*, 30 while related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and 31 more. 32 33 Normally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and 34 *PUT* requests are rather invoked by using dedicated command line options. 35 36 This option only changes the actual word used in the HTTP request, it does not 37 alter the way curl behaves. For example if you want to make a proper HEAD 38 request, using -X HEAD does not suffice. You need to use the --head option. 39 40 The method string you set with --request is used for all requests, which 41 if you for example use --location may cause unintended side-effects when curl 42 does not change request method according to the HTTP 30x response codes - and 43 similar. 44 45 ## FTP 46 Specifies a custom FTP command to use instead of *LIST* when doing file lists 47 with FTP. 48 49 ## POP3 50 Specifies a custom POP3 command to use instead of *LIST* or *RETR*. 51 (Added in 7.26.0) 52 53 ## IMAP 54 Specifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0) 55 56 ## SMTP 57 Specifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0)