Created
November 24, 2019 23:25
-
-
Save dannylee8/c52264112bc94408adea8cb1fa9ba1ad to your computer and use it in GitHub Desktop.
VS Code Snippet sample 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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