Question:
When I try to access the form data I send with a jQuery AJAX PUT request, I get this response:Array ( [——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition:_form-data;_name] => "id" 7 ——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition: form-data; name="naam" Eiusmod alias est do ——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition: form-data; name="email" zatapohopu@mailinator.com ——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition: form-data; name="adres" Voluptates adipisici ——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition: form-data; name="telefoonnummer" 0612345678 ——WebKitFormBoundary4TPPQZu7B7WFrUsv Content-Disposition: form-data; name="rol" 4 ——WebKitFormBoundary4TPPQZu7B7WFrUsv– ) Warning: Undefined array key "id" in C:\xampp\htdocs\P08\hoornhek\api\gebruiker.php on line 22
I also can’t get the array keys. This is my jQuery AJAX request:
Answer:
You cant access the data from a PUT request via $_REQUEST. You’d need something like:If you have better answer, please add a comment about this, thank you!