xref: /aosp_15_r20/external/curl/docs/cmdline-opts/post302.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: post302
5*6236dae4SAndroid Build Coastguard WorkerHelp: Do not switch to GET after a 302 redirect
6*6236dae4SAndroid Build Coastguard WorkerProtocols: HTTP
7*6236dae4SAndroid Build Coastguard WorkerAdded: 7.19.1
8*6236dae4SAndroid Build Coastguard WorkerCategory: http post
9*6236dae4SAndroid Build Coastguard WorkerMulti: boolean
10*6236dae4SAndroid Build Coastguard WorkerSee-also:
11*6236dae4SAndroid Build Coastguard Worker  - post301
12*6236dae4SAndroid Build Coastguard Worker  - post303
13*6236dae4SAndroid Build Coastguard Worker  - location
14*6236dae4SAndroid Build Coastguard WorkerExample:
15*6236dae4SAndroid Build Coastguard Worker  - --post302 --location -d "data" $URL
16*6236dae4SAndroid Build Coastguard Worker---
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard Worker# `--post302`
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard WorkerRespect RFC 7231/6.4.3 and do not convert POST requests into GET requests when
21*6236dae4SAndroid Build Coastguard Workerfollowing a 302 redirect. The non-RFC behavior is ubiquitous in web browsers,
22*6236dae4SAndroid Build Coastguard Workerso curl does the conversion by default to maintain consistency. However, a
23*6236dae4SAndroid Build Coastguard Workerserver may require a POST to remain a POST after such a redirection. This
24*6236dae4SAndroid Build Coastguard Workeroption is meaningful only when using --location.
25