From 1b57f9eb2b32589b23c409e8b8e63df3574ffbe6 Mon Sep 17 00:00:00 2001 From: KnifeLemon Date: Mon, 3 Feb 2025 23:08:24 +0900 Subject: [PATCH] Added PUT, PATCH, DELETE methods for data --- flight/net/Request.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flight/net/Request.php b/flight/net/Request.php index 9cdc64b..02e012f 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -213,6 +213,16 @@ class Request } } + // Check PUT, PATCH, DELETE for data + if ($this->method === 'PUT' || $this->method === 'DELETE' || $this->method === 'PATCH') { + $body = $this->getBody(); + if ($body !== '') { + $data = []; + parse_str($body, $data); + $this->data->setData($data); + } + } + return $this; }