Added API endpoint PUT /preorder/{id} to update contact data
This commit is contained in:
@@ -185,7 +185,7 @@ class mfBaseApicontroller {
|
||||
|
||||
// POST Request
|
||||
$post = [];
|
||||
if($this->http_method == "POST") {
|
||||
if($this->http_method == "POST" || $this->http_method == "PUT") {
|
||||
$post = $this->getPostRequest();
|
||||
if($post === false) {
|
||||
$post = [];
|
||||
@@ -234,6 +234,11 @@ class mfBaseApicontroller {
|
||||
return $request_body;
|
||||
}
|
||||
|
||||
if($this->http_method == "PUT") {
|
||||
// PUT requests in application/x-www-form-urlencoded format need special handling
|
||||
parse_str(file_get_contents("php://input"), $_POST);
|
||||
}
|
||||
|
||||
// Request body is urlencoded or multipart-formdata
|
||||
if(array_key_exists("CONTENT_TYPE", $_SERVER) && preg_match('#charset\s*=\s*["\']?([^ "\']+)["\']?\s*;?#i', $_SERVER["CONTENT_TYPE"], $m)) {
|
||||
$request_charset = strtolower($m[1]);
|
||||
|
||||
Reference in New Issue
Block a user