Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const body = {
- client_id: "my_id",
- client_secret: "my_secret",
- grant_type: "client_credentials"
- }
- fetch('https://id.twitch.tv/oauth2/token', {
- method: 'post',
- headers: {
- 'Accept': 'application/json, text/plain, */*',
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(body)
- })
- .then(function (response) {
- return response.json();
- })
- .then(function (result) {
- console.log(result);
- })
- .catch (function (error) {
- console.log('Request failed', error);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement