I am utilizing the fetch method to execute a POST request and include credentials. Below is an example of my implementation:
async function sendData(apiEndpoint, dataPackage) {
const result = await fetch(apiEndpoint, {
method: 'POST',
body: dataPackage,
credentials: 'include'
});
return result.json();
}
I am trying to figure out what timeout is applied automatically when using this fetch request. Additionally, I would like to know how to change this setting to enforce a timeout of 3 seconds or even keep it waiting indefinitely. Any guidance or suggestions on configuring the request timeout would be very helpful.