Skip to content

Instantly share code, notes, and snippets.

@jsakas
Last active October 28, 2018 05:38
Show Gist options
  • Save jsakas/7ab4bd6094d67860937b1d19add65809 to your computer and use it in GitHub Desktop.
Save jsakas/7ab4bd6094d67860937b1d19add65809 to your computer and use it in GitHub Desktop.
const discogs = {
oauth_consumer_key: "xxxxx",
oauth_signature: "xxxxx",
}
const Auth = `OAuth
oauth_consumer_key="${discogs.consumer_key}",
# notice the ampersand after the consumer secret:
oauth_signature="${discogs.consumer_secret}&",
oauth_nonce="${Date.now()}",
oauth_signature_method="PLAINTEXT",
oauth_timestamp="${Date.now()}",
`.replace(/\n/g, '');
fetch('https://api.discogs.com/oauth/request_token', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': Auth,
},
method: 'GET',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment