Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到使用Siesta Framework取消请求的任何方法。这可能吗,怎么做?
我发现有一个方法cancel(),应该在Request对象上调用。如文档所述,如果请求已经启动,则不能保证真正取消请求,但它至少会忽略结果并向您发送完成/失败,然后您可以相应地处理。
cancel()
Request
例子:
let siestaRequest = MyAPI.profile.request(.post, json: ["foo": [1,2,3]]) // when needed, later siestaRequest.cancel()