113498266Sopenharmony_ci---
213498266Sopenharmony_cic: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
313498266Sopenharmony_ciSPDX-License-Identifier: curl
413498266Sopenharmony_ciLong: request
513498266Sopenharmony_ciShort: X
613498266Sopenharmony_ciArg: <method>
713498266Sopenharmony_ciHelp: Specify request method to use
813498266Sopenharmony_ciCategory: connection
913498266Sopenharmony_ciAdded: 6.0
1013498266Sopenharmony_ciMulti: single
1113498266Sopenharmony_ciSee-also:
1213498266Sopenharmony_ci  - request-target
1313498266Sopenharmony_ciExample:
1413498266Sopenharmony_ci  - -X "DELETE" $URL
1513498266Sopenharmony_ci  - -X NLST ftp://example.com/
1613498266Sopenharmony_ci---
1713498266Sopenharmony_ci
1813498266Sopenharmony_ci# `--request`
1913498266Sopenharmony_ci
2013498266Sopenharmony_ciChange the method to use when starting the transfer.
2113498266Sopenharmony_ci
2213498266Sopenharmony_cicurl passes on the verbatim string you give it its the request without any
2313498266Sopenharmony_cifilter or other safe guards. That includes white space and control characters.
2413498266Sopenharmony_ci
2513498266Sopenharmony_ci## HTTP
2613498266Sopenharmony_ciSpecifies a custom request method to use when communicating with the HTTP
2713498266Sopenharmony_ciserver. The specified request method is used instead of the method otherwise
2813498266Sopenharmony_ciused (which defaults to *GET*). Read the HTTP 1.1 specification for details
2913498266Sopenharmony_ciand explanations. Common additional HTTP requests include *PUT* and *DELETE*,
3013498266Sopenharmony_ciwhile related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and
3113498266Sopenharmony_cimore.
3213498266Sopenharmony_ci
3313498266Sopenharmony_ciNormally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and
3413498266Sopenharmony_ci*PUT* requests are rather invoked by using dedicated command line options.
3513498266Sopenharmony_ci
3613498266Sopenharmony_ciThis option only changes the actual word used in the HTTP request, it does not
3713498266Sopenharmony_cialter the way curl behaves. So for example if you want to make a proper HEAD
3813498266Sopenharmony_cirequest, using -X HEAD does not suffice. You need to use the --head option.
3913498266Sopenharmony_ci
4013498266Sopenharmony_ciThe method string you set with --request is used for all requests, which
4113498266Sopenharmony_ciif you for example use --location may cause unintended side-effects when curl
4213498266Sopenharmony_cidoes not change request method according to the HTTP 30x response codes - and
4313498266Sopenharmony_cisimilar.
4413498266Sopenharmony_ci
4513498266Sopenharmony_ci## FTP
4613498266Sopenharmony_ciSpecifies a custom FTP command to use instead of *LIST* when doing file lists
4713498266Sopenharmony_ciwith FTP.
4813498266Sopenharmony_ci
4913498266Sopenharmony_ci## POP3
5013498266Sopenharmony_ciSpecifies a custom POP3 command to use instead of *LIST* or *RETR*.
5113498266Sopenharmony_ci(Added in 7.26.0)
5213498266Sopenharmony_ci
5313498266Sopenharmony_ci## IMAP
5413498266Sopenharmony_ciSpecifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0)
5513498266Sopenharmony_ci
5613498266Sopenharmony_ci## SMTP
5713498266Sopenharmony_ciSpecifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0)
58