Why my web api response is being cancelled ?

mehmood tekfirst 771 Reputation points
2022-07-05T06:23:42.477+00:00

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?

217631-image.png

please guide

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. mehmood tekfirst 771 Reputation points
    2022-07-05T08:11:21.457+00:00

    Thank you . My issue has been solved.

    0 comments No comments