Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

GET State Information

Get state information of request

Description

Use a GET method to get information about the state of a request. The URI of the self field serves as the addressable resource for the method. Possible states are: READING, IN_QUEUE, PROCESSING, READY, ERROR, and CANCELLED.

Request

HTTP Method

GET

URI

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

Response

Success

HTTP Status Code

200 OK

Body

NameDescriptionValue-Type
requestURI to current request.{request-uri-string}
lastModifiedSeqNumber indicating when the current request was last modified.{server-state-number}
stateState of current request.{request-state-string}

Possible states:

READING
IN_QUEUE
PROCESSING
READY
ERROR
CANCELLED

Example:

{
  "request": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/c5666088-b087-4bae-aa7d-d8470e6e082d",
  "lastModifiedSeq": 19,
  "state": "READY"
}

Error

HTTP Status Code

400 NoMatchForQueryParams— Query with invalid request ID.

404 URL not found

Sample Call

HTTP

Request:

GET /~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/c5666088-b087-4bae-aa7d-d8470e6e082d/info HTTP/1.1
Host: localhost
Port: 9910

Response:

Status Code: 200 OK
{
  "request": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/c5666088-b087-4bae-aa7d-d8470e6e082d",
  "lastModifiedSeq": 19,
  "state": "READY"
}

JavaScript

var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
});
xhr.open("GET", "http://localhost:9910/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/c5666088-b087-4bae-aa7d-d8470e6e082d/info");
xhr.send(data);

Introduced in R2016b