docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
---
|
2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2016-11-28 08:01:13 +08:00
|
|
|
Long: request
|
|
|
|
Short: X
|
2021-12-04 07:20:42 +08:00
|
|
|
Arg: <method>
|
|
|
|
Help: Specify request method to use
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: connection
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 6.0
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: single
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
See-also:
|
|
|
|
- request-target
|
|
|
|
Example:
|
|
|
|
- -X "DELETE" $URL
|
|
|
|
- -X NLST ftp://example.com/
|
2016-11-28 08:01:13 +08:00
|
|
|
---
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
|
|
|
|
# `--request`
|
|
|
|
|
2023-08-08 21:44:14 +08:00
|
|
|
Change the method to use when starting the transfer.
|
2023-11-02 20:05:10 +08:00
|
|
|
|
2024-06-02 09:42:52 +08:00
|
|
|
curl passes on the verbatim string you give it in the request without any
|
2023-11-02 20:05:10 +08:00
|
|
|
filter or other safe guards. That includes white space and control characters.
|
2024-01-09 17:36:14 +08:00
|
|
|
|
|
|
|
## HTTP
|
2023-09-08 20:32:29 +08:00
|
|
|
Specifies a custom request method to use when communicating with the HTTP
|
|
|
|
server. The specified request method is used instead of the method otherwise
|
|
|
|
used (which defaults to *GET*). Read the HTTP 1.1 specification for details
|
|
|
|
and explanations. Common additional HTTP requests include *PUT* and *DELETE*,
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
while related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and
|
2023-09-08 20:32:29 +08:00
|
|
|
more.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
Normally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and
|
|
|
|
*PUT* requests are rather invoked by using dedicated command line options.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
|
|
|
This option only changes the actual word used in the HTTP request, it does not
|
2024-02-27 17:35:28 +08:00
|
|
|
alter the way curl behaves. For example if you want to make a proper HEAD
|
2023-09-08 20:32:29 +08:00
|
|
|
request, using -X HEAD does not suffice. You need to use the --head option.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
2023-09-08 20:32:29 +08:00
|
|
|
The method string you set with --request is used for all requests, which
|
2016-11-28 08:01:13 +08:00
|
|
|
if you for example use --location may cause unintended side-effects when curl
|
2021-10-31 23:34:44 +08:00
|
|
|
does not change request method according to the HTTP 30x response codes - and
|
2016-11-28 08:01:13 +08:00
|
|
|
similar.
|
2024-01-09 17:36:14 +08:00
|
|
|
|
|
|
|
## FTP
|
2023-08-01 20:11:50 +08:00
|
|
|
Specifies a custom FTP command to use instead of *LIST* when doing file lists
|
2016-11-28 08:01:13 +08:00
|
|
|
with FTP.
|
2024-01-09 17:36:14 +08:00
|
|
|
|
|
|
|
## POP3
|
2023-08-01 20:11:50 +08:00
|
|
|
Specifies a custom POP3 command to use instead of *LIST* or *RETR*.
|
2021-09-28 16:30:59 +08:00
|
|
|
(Added in 7.26.0)
|
2024-01-09 17:36:14 +08:00
|
|
|
|
|
|
|
## IMAP
|
2023-08-01 20:11:50 +08:00
|
|
|
Specifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0)
|
2024-01-09 17:36:14 +08:00
|
|
|
|
|
|
|
## SMTP
|
2023-08-12 05:51:15 +08:00
|
|
|
Specifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0)
|