How to get the data from PUT HTTP Request (form-data)
<p>This is my function in my API I need to get the data from the form-data from the HTTP request.</p>

<p>I need to get the put values to update my data in my class query.</p>

<pre><code>    function method()
    {
        $method = $_SERVER['REQUEST_METHOD'];

        return $method;
    }

    function updateUser()
    {
        $method = method();

        if($method == 'PUT'){

            $put_data = file_get_contents("php://input");

            parse_str($put_data, $post_vars);


            return $post_vars;


        }else{

            $status = '400 Bad Request';

            return $status;

        }
     }
</code></pre>

<p>{"------WebKitFormBoundaryYKcobRh4FtrGCYaI\r\nContent-Disposition:_form-data;_name":"\"test\"\r\n\r\ntest_value\r\n------WebKitFormBoundaryYKcobRh4FtrGCYaI--\r\n"}</p>

<p>This is what i get from the return $post_vars</p>

<p>I need to have test: test_value</p>