Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios-client could also support AbortSignal #4047

Closed
jpa00 opened this issue Jun 14, 2022 · 2 comments
Closed

Axios-client could also support AbortSignal #4047

jpa00 opened this issue Jun 14, 2022 · 2 comments

Comments

@jpa00
Copy link

jpa00 commented Jun 14, 2022

NSwag currently generates Axios-client with support for a CancelToken, and the useAbortSignal-flag has no effect. Axios does have support for AbortSignal as well, so could the useAbortSignal-flag be used with the Axios template as well to accept AbortSignal as the last parameter instead of a CancelToken? This could be set on the AxiosRequestConfig-object directly, just like the CancelToken currently is.

@BenJenkinson
Copy link

Axios have also deprecated their CancelToken API, as of v0.22.0 on Oct 1, 2021

The axios cancel token API is based on the withdrawn cancellable promises proposal.

This API is deprecated since v0.22.0 and shouldn't be used in new projects

📚 https://github.com/axios/axios#canceltoken-deprecated

@BenJenkinson
Copy link

Related issue: #3849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants