Skip to content

Instantly share code, notes, and snippets.

@dannylee8
Created November 24, 2019 23:25
Show Gist options
  • Save dannylee8/c52264112bc94408adea8cb1fa9ba1ad to your computer and use it in GitHub Desktop.
Save dannylee8/c52264112bc94408adea8cb1fa9ba1ad to your computer and use it in GitHub Desktop.
VS Code Snippet sample 2
const HEADERS = {
"content-type": "application/json",
"accept" : "application/json"
}
function doFetch (myObject, id) {
fetch(`${SITE}/${id}`, {
method: "PATCH"
headers: HEADERS
body: JSON.stringify({
myObject.Key: myObject.value
})
}
)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment