I am using fetch post method in react js and when sending request to backend it takes 7 mints to provide the response and before that front end automatically gets timed out. Can you please help me out how to set 10 mints time in fetch method for front to wait for the response and only gets timed out when backend takes more than 10 mints. Please let us know if i have to install any dependency.
Also just to inform you i have installed dependency "whatwg-fetch-timeout": "^2.0.2-timeout" and it was working fine on development server but when tried to create build package it failed to create build the build. sample code:
fetch("http://" + hostName + ":" + port + "/searchData", {
method: "POST",
headers: {
"Content-Type": "application/json",
Login: login,
ID: id
},
body: JSON.stringify({
StartDate: StartDate === "" ? null : StartDate,
EndDate: EndDate === "" ? null : EndDate,
FileName: FileName === "" ? null : FileName,
RecordCount: RecordCount === "" ? null : RecordCount,
Status: Status
})
})
.then(response => {
resStatus = response.status;
return response.json();
})
.then(responseJson => {
//source code
})
.catch(error => {});