Skip to content

Instantly share code, notes, and snippets.

@flybayer
Last active April 15, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flybayer/ed245ba248b74864143c5b9ec21bcddb to your computer and use it in GitHub Desktop.
Save flybayer/ed245ba248b74864143c5b9ec21bcddb to your computer and use it in GitHub Desktop.
const res = await fetch(action, {
method,
body: data,
headers: {
Accept: 'application/json',
},
})
if (res.ok && res.headers.get('Location')) {
console.log(res.headers.get('Location'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment