fetch('https://mydomain.com/path/to/resource/v1',
{ method: 'POST',
headers: {'Content-Type': 'application/json'},
body : JSON.stringify( { 'name': 'john' } )
}
).then( res => res.json()
).then( console.log);
Last active
July 6, 2023 01:53
-
-
Save snambi/36c9270644436fcd842752b83d511df3 to your computer and use it in GitHub Desktop.
Javascript Fetch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment