[Edit]
+
0
-
0
JavaScript (Vanilla JS) AJAX PUT request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25<!DOCTYPE html> <html> <body> <script> var bodyData = 'text'; fetch('/examples', { method: 'PUT', headers: { 'Content-Type': 'text/plain', }, body: bodyData, }) .then((response) => response.json()) .then((data) => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); }); </script> </body> </html>