xref: /aosp_15_r20/external/curl/docs/cmdline-opts/request.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: request
5*6236dae4SAndroid Build Coastguard WorkerShort: X
6*6236dae4SAndroid Build Coastguard WorkerArg: <method>
7*6236dae4SAndroid Build Coastguard WorkerHelp: Specify request method to use
8*6236dae4SAndroid Build Coastguard WorkerCategory: connection pop3 ftp imap smtp
9*6236dae4SAndroid Build Coastguard WorkerAdded: 6.0
10*6236dae4SAndroid Build Coastguard WorkerMulti: single
11*6236dae4SAndroid Build Coastguard WorkerSee-also:
12*6236dae4SAndroid Build Coastguard Worker  - request-target
13*6236dae4SAndroid Build Coastguard WorkerExample:
14*6236dae4SAndroid Build Coastguard Worker  - -X "DELETE" $URL
15*6236dae4SAndroid Build Coastguard Worker  - -X NLST ftp://example.com/
16*6236dae4SAndroid Build Coastguard Worker---
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard Worker# `--request`
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard WorkerChange the method to use when starting the transfer.
21*6236dae4SAndroid Build Coastguard Worker
22*6236dae4SAndroid Build Coastguard Workercurl passes on the verbatim string you give it in the request without any
23*6236dae4SAndroid Build Coastguard Workerfilter or other safe guards. That includes white space and control characters.
24*6236dae4SAndroid Build Coastguard Worker
25*6236dae4SAndroid Build Coastguard Worker## HTTP
26*6236dae4SAndroid Build Coastguard WorkerSpecifies a custom request method to use when communicating with the HTTP
27*6236dae4SAndroid Build Coastguard Workerserver. The specified request method is used instead of the method otherwise
28*6236dae4SAndroid Build Coastguard Workerused (which defaults to *GET*). Read the HTTP 1.1 specification for details
29*6236dae4SAndroid Build Coastguard Workerand explanations. Common additional HTTP requests include *PUT* and *DELETE*,
30*6236dae4SAndroid Build Coastguard Workerwhile related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and
31*6236dae4SAndroid Build Coastguard Workermore.
32*6236dae4SAndroid Build Coastguard Worker
33*6236dae4SAndroid Build Coastguard WorkerNormally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and
34*6236dae4SAndroid Build Coastguard Worker*PUT* requests are rather invoked by using dedicated command line options.
35*6236dae4SAndroid Build Coastguard Worker
36*6236dae4SAndroid Build Coastguard WorkerThis option only changes the actual word used in the HTTP request, it does not
37*6236dae4SAndroid Build Coastguard Workeralter the way curl behaves. For example if you want to make a proper HEAD
38*6236dae4SAndroid Build Coastguard Workerrequest, using -X HEAD does not suffice. You need to use the --head option.
39*6236dae4SAndroid Build Coastguard Worker
40*6236dae4SAndroid Build Coastguard WorkerThe method string you set with --request is used for all requests, which
41*6236dae4SAndroid Build Coastguard Workerif you for example use --location may cause unintended side-effects when curl
42*6236dae4SAndroid Build Coastguard Workerdoes not change request method according to the HTTP 30x response codes - and
43*6236dae4SAndroid Build Coastguard Workersimilar.
44*6236dae4SAndroid Build Coastguard Worker
45*6236dae4SAndroid Build Coastguard Worker## FTP
46*6236dae4SAndroid Build Coastguard WorkerSpecifies a custom FTP command to use instead of *LIST* when doing file lists
47*6236dae4SAndroid Build Coastguard Workerwith FTP.
48*6236dae4SAndroid Build Coastguard Worker
49*6236dae4SAndroid Build Coastguard Worker## POP3
50*6236dae4SAndroid Build Coastguard WorkerSpecifies a custom POP3 command to use instead of *LIST* or *RETR*.
51*6236dae4SAndroid Build Coastguard Worker(Added in 7.26.0)
52*6236dae4SAndroid Build Coastguard Worker
53*6236dae4SAndroid Build Coastguard Worker## IMAP
54*6236dae4SAndroid Build Coastguard WorkerSpecifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0)
55*6236dae4SAndroid Build Coastguard Worker
56*6236dae4SAndroid Build Coastguard Worker## SMTP
57*6236dae4SAndroid Build Coastguard WorkerSpecifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0)
58