async function requestFile(endpoint, options = {}) {
endpoint = configUT.url + endpoint;
let url = encodeURI(endpoint);
let response = await fetch(endpoint,
Object.assign({
headers: {
Authorization : `Bearer ${configUT.token}`,
// Accept: 'application/json',
'Content-Type': 'multipart/form-data',
},
}, options
));
console.log(response);
if (response.ok) {
let data = await response.json();
console.log(data);
return data
}
};
то есть под капотом fetch