Skip to content

Commit

Permalink
Added PUT, PATCH, DELETE methods for data
Browse files Browse the repository at this point in the history
  • Loading branch information
KnifeLemon authored Feb 3, 2025
1 parent da6540b commit 1b57f9e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions flight/net/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ public function init(array $properties = []): self
}
}

// 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;
}

Expand Down

0 comments on commit 1b57f9e

Please sign in to comment.