fetch("http://www.example.com/books/1", { // note we are going to /1 method: "PATCH", headers: { "Content-Type" : "application/json" }, body: JSON.stringify( { "likes": 5 // we are changing the "likes" value to 5 } ) });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter