主要内容

后取消请求

取消请求

描述

使用POST方法取消请求。你只能取消那些还没有完成的请求。

请求

HTTP方法

帖子

URI

http://host {request-uri-string} /取消

响应

成功

HTTP状态代码

204没有内容

错误

HTTP状态代码

404年RequestNotFound

410年RequestAlreadyCompleted

410年RequestAlreadyCancelled

410年RequestAlreadyDeleted

500年InternalServerError

示例调用

HTTP

要求:

POST / ~ f76280c5 - b94c 4 - cd9 - 8 eb6 - 841532788583 /请求/ ef90fca4 - 0 - d3c - 4395 - 8 - dc8 af8a8905b1fe /取消HTTP / 1.1主持人:localhost: 9910

回应:

状态码:204没有内容

JavaScript

var数据=零;var xhr = new XMLHttpRequest ();xhr。addEventListener (“readystatechange函数(){如果(这一点。readyState = = = 4) {console.log (this.responseText);}});xhr。open(“后”、“http://localhost: 9910 / ~ f76280c5 b94c - 4 cd9 - 8 eb6 - 841532788583 /请求/ ef90fca4 - 0 - d3c - 4395 - 8 - dc8 af8a8905b1fe /取消”);xhr.send(数据);

版本历史

介绍了R2016b