I am developing a REST Api in yii while processing the request client data cannot be read
I tried to use below code I get the output
var_dump(file_get_contents("php://input"));
output is:
string(444) "------WebKitFormBoundaryH6R7rwQdVzYGvtbp
Content-Disposition: form-data; name="username"
anki------WebKitFormBoundaryH6R7rwQdVzYGvtbp
Content-Disposition: form-data; name="password"
anki------WebKitFormBoundaryH6R7rwQdVzYGvtbp
Content-Disposition: form-data; name="email"
anki@yahoo.in------WebKitFormBoundaryH6R7rwQdVzYGvtbp
Content-Disposition: form-data; name="contact"
787------WebKitFormBoundaryH6R7rwQdVzYGvtbp–"
But when I use the below code I get null as output
header('Content-Type: application/json');
$data = json_decode(file_get_contents("php://input"), true);
var_dump($data);