Documentation

POST Cancel Request

Cancel a request

Description

Use a POST method to cancel a request. Only requests that have not already completed can be canceled.

Request

HTTP Method

POST

URI

http://host:port/{request-uri-string}/cancel

Response

Success

HTTP Status Code

204 No Content

Error

HTTP Status Code

404 RequestNotFound

410 RequestAlreadyCompleted

410 RequestAlreadyCancelled

410 RequestAlreadyDeleted

500 InternalServerError

Sample Call

HTTP

Request:

POST /~f76280c5-b94c-4cd9-8eb6-841532788583/requests/ef90fca4-0d3c-4395-8dc8-af8a8905b1fe/cancel HTTP/1.1
Host: localhost:9910 

Response:

Status Code: 204 No Content

JavaScript

var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("POST", "http://localhost:9910/~f76280c5-b94c-4cd9-8eb6-841532788583/requests/ef90fca4-0d3c-4395-8dc8-af8a8905b1fe/cancel");
xhr.send(data);

Introduced in R2016b