Get state information of request
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.
GET
http://host:port/{request-uri-string}/info
200 OK
| Name | Description | Value-Type |
|---|---|---|
request | URI to current request. | {request-uri-string} |
lastModifiedSeq | Number indicating when the current request was last modified. | {server-state-number} |
state | State 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"
} |
400 NoMatchForQueryParams— Query with
invalid request ID.
404 URL not found
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"
} |
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); |