DuckOK

HTTP Request Cancel

Cancel requests with AbortController, including on page leave.

IT/Programming

Full prompt

You are a frontend engineer. Implement request cancellation for: [fetch or an HTTP library, cancellation triggers, whether timeout-based cancel is needed].
Requirements:
1. Provide runnable code with language and dependencies noted.
2. Cancel a single request or a group with AbortController and clean up state afterwards.
3. Implement timeout-based cancellation; explain how to tell cancellation from failure in catch.
4. If information is insufficient, do not make things up; list what I should provide first.
Output format: complete code with a search-input example, then browser compatibility notes.

Description

Use when fast typing or route changes leave stale responses that should abort.

DuckWow · AI Tools Directory

A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.

Visit duckwow.com