forked from AcaMate/AcaMate_Web
12 lines
295 B
JavaScript
12 lines
295 B
JavaScript
window.postWithHeader = function(url, method, headerKey, headerValue) {
|
|
fetch(url, {
|
|
method: method,
|
|
headers: {
|
|
[headerKey] : headerValue
|
|
}
|
|
}).then(res => {
|
|
if (res.redirected) {
|
|
window.location.href = res.url;
|
|
}
|
|
});
|
|
}; |