blob: c837f0987fda9ab84292dba53e6b3912f517b8a3 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: request
4Short: X
5Arg: <method>
6Help: Specify request method to use
7Category: connection
8Example: -X "DELETE" $URL
9Example: -X NLST ftp://example.com/
10Added: 6.0
11See-also: request-target
12Multi: single
13---
14(HTTP) Specifies a custom request method to use when communicating with the
15HTTP server. The specified request method will be used instead of the method
16otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
17details and explanations. Common additional HTTP requests include PUT and
18DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
19more.
20
21Normally you do not need this option. All sorts of GET, HEAD, POST and PUT
22requests are rather invoked by using dedicated command line options.
23
24This option only changes the actual word used in the HTTP request, it does not
25alter the way curl behaves. So for example if you want to make a proper HEAD
26request, using -X HEAD will not suffice. You need to use the --head option.
27
28The method string you set with --request will be used for all requests, which
29if you for example use --location may cause unintended side-effects when curl
30does not change request method according to the HTTP 30x response codes - and
31similar.
32
33(FTP)
34Specifies a custom FTP command to use instead of LIST when doing file lists
35with FTP.
36
37(POP3)
38Specifies a custom POP3 command to use instead of LIST or RETR.
39(Added in 7.26.0)
40
41(IMAP)
42Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0)
43
44(SMTP)
45Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)