Currently, I'm experimenting with utilizing AbortController to cancel an API call. The axios library is being used for this particular call. Before integrating it into my project, I decided to test the cancellation procedure with a simple call:
const controller = new AbortController();
const request = axios.get("https://www.google.com:81", {signal: controller.signal});
controller.abort();
Oddly enough, when I executed this code snippet as a test, the request was not aborted as expected. Instead, it just timed out, which seemed peculiar considering I wasn't awaiting it. Can anyone pinpoint where I might be going wrong? It's possible that I haven't fully grasped the correct usage of AbortController, but based on the example code, everything seems sound to me.