如何取消一个HTTP获取()的要求? [英] How do I cancel an HTTP fetch() request?

查看:92
本文介绍了如何取消一个HTTP获取()的要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有用于从JavaScript发出请求一个新的API:取()。是否有任何内置的机制,在飞行中取消这些要求?

There is a new API for making requests from JavaScript: fetch(). Is there any built in mechanism for canceling these requests in-flight?

推荐答案

我不相信有一种方法来取消现有获取API的请求。有一个在 https://github.com/whatwg/fetch/issues/27 <关于它正在进行的讨论/ A>

I don't believe there is a way to cancel a request with the existing fetch API. There is ongoing discussion about it at https://github.com/whatwg/fetch/issues/27

这篇关于如何取消一个HTTP获取()的要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆