Generation

generate functionFri, 27 Jan 2023

service request to the json server to update data in PUT method

function updateData(data) { return fetch("https://jsonplaceholder.typicode.com/posts/1", { method: "PUT", body: JSON.stringify(data), headers: { "Content-type": "application/json; charset=UTF-8" } }).then(response => response.json()); }

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code