Skip to content

Commit 1b57f9e

Browse files
authored
Added PUT, PATCH, DELETE methods for data
1 parent da6540b commit 1b57f9e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

flight/net/Request.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ public function init(array $properties = []): self
213213
}
214214
}
215215

216+
// Check PUT, PATCH, DELETE for data
217+
if ($this->method === 'PUT' || $this->method === 'DELETE' || $this->method === 'PATCH') {
218+
$body = $this->getBody();
219+
if ($body !== '') {
220+
$data = [];
221+
parse_str($body, $data);
222+
$this->data->setData($data);
223+
}
224+
}
225+
216226
return $this;
217227
}
218228

0 commit comments

Comments
 (0)