-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
HttpFoundationRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
Description
Hi,
I'd like to propose $request->body->get()
(an InputBag
) to provide uniform access to a structured request body payload, regardless of content-type.
$request->request
always looked weird to me, and is bound to $_POST
, thus application/x-form-urlencoded
:
public static function createFromGlobals(): static |
Then for application/json
one needs toArray()
:
public function toArray(): array |
Example
$request->body = new InputBag($_POST ?: $request->toArray());
jvasseur, stephanvierkant, kbond, dsentker, creiner and 6 moredvmuccillo and ging-dev
Metadata
Metadata
Assignees
Labels
HttpFoundationRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)