Unable to make a fetch request to an apps script function using Run JS Code

I am trying to make a fetch request to a google apps script using below Run JS Code resource. I deployed the google apps script as a web app and invoking from retool. The reason I would like to use fetch within retool is I would like to abort it using AbortController as soon as the request is submitted to Google server as this would be a long running back end process. When the JS code is triggered I am seeing at the Google side an error saying "Script function not found : doGet" where as I am calling doPost function specified as URL parameter and also as part of fetch call options ("method": "POST")
Not sure what query is being sent to Google server. Is it possible to have a trace of this as the normal debug is not showing any thing in this regard
Alternately if there are other ways to achieve the objective of executing such long running back end jobs in google server are available please suggest

Code snippets are below

const url = "https://script.google.com/macros/s/scriptID/exec?function=doPost";

function fetchDataWithTimeout(url,options, timeoutInMilliseconds) {
const controller = new AbortController();
const signal = controller.signal;
const timeout = setTimeout(() => controller.abort(), timeoutInMilliseconds);
try
{
console.log('inside try block, before fetch')
return fetch(url, {options, signal })
.then(response => {return response.json()} )
.then(result => {console.log(' result from api call', result);
return result;})
}
catch (error)
{
clearTimeout(timeout); // Clear timeout even on error
if (error.name === 'AbortError') {
console.log('Request aborted due to timeout',error.message, error.name);
} else
{
console.error('Error fetching data from google service:', error.message, error.name);
}
throw error; // Re-throw the error for further handling (o
}
//const response = await fetch(url);
clearTimeout(timeout); // Clear timeout if request finishes successfully
}

Thanks