Нужно отправить запрос и получить данные в JSON, делаю так, но получаю ошибки.
async function getData(url = 'https://*****.myjetbrains.com/youtrack/api/issues', data = {}) {
// Default options are marked with *
const response = await fetch(url, {
method: 'GET',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'fields': 'id,login,name,email',
'Authorization': 'Bearer ***************',
'Content-Type': 'application/json',
},
redirect: 'follow',
referrerPolicy: 'no-referrer',
body: JSON.stringify(data)
});
return await response.json();
console.log(response.json)
}
getData('https://********.myjetbrains.com/youtrack/api/issues', data = {})