Last active
November 9, 2022 08:24
-
-
Save ahoNerd/3b594307db295ed81f7afed5bbc765fb to your computer and use it in GitHub Desktop.
fetch PUT
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
class AhoHTTP { | |
async put(url: RequestInfo | URL, data: any) { | |
const response = await fetch(url, { | |
method: 'PUT', | |
headers: { | |
'Content-type': 'application/json', | |
}, | |
body: JSON.stringify(data), | |
}) | |
const resData = await response.json() | |
return resData | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment