Thank you . My issue has been solved.
Why my web api response is being cancelled ?
Hi,
I am using Asp.Net MVC/Web API Core 6.
My web api call is being cancelled and I am wondering, what is being happened in it?
I have a service called payment api. When I send a call with required parameters and I hit the debugger then It shows me the flow line by line in the visual studio 2022.
There was nothing to stop the flow even a single statement nor even any error.
But when I am calling through fetch API then it is automatically send the cancelled response back .
This is the client side call.
let resultPaymentPage = [];
const settingsPaymentPage = {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(requestPaymentObj)
};
try {
debugger;
const responsePaymentPage = await fetch(APP_SubmitPaymentForm, settingsPaymentPage);
if (responsePaymentPage && !responsePaymentPage.ok) {
resultDriverDetailPage = [];
}
else {
resultPaymentPage = await responsePaymentPage.json();
debugger;
if (resultPaymentPage) {
loadThankYouPage(requestPaymentObj);
}
}
} catch (e) {
console.log(e);
}
The occurred the very first line . see below
const responsePaymentPage = await fetch(APP_SubmitPaymentForm, settingsPaymentPage);
The server side api is a bit long logic and after persisting the data in the tables , there is an email which is being sent to the end user.
What can be the issue ? How can I trouble shoot it to see the depth detail of the error?
please guide