View how an asynchronous request made to the server is represented
Use a GET method to view the representation of an asynchronous
request on the server. The URI of the self field
serves as the addressable resource for the method.
GET
http://host:port/{request-uri-string}
200 OK
| Name | Description | Value-Type |
|---|---|---|
id | ID of a particular request. | {id-string} |
self | URI of particular request. | {request-uri-string} |
up | URI of a collection of requests tied to a particular client. | {request-collection-uri-string} |
lastModifiedSeq | Number indicating when a request represented by self was
last modified. | {server-state-number} |
state | State of a request. | {request-state-string}Possible states: READING IN_QUEUE PROCESSING READY ERROR CANCELLED |
client | Client id or name that was specified as a query parameter while initiating an asynchronous request. | {client-id-string} |
Example:
{
"id": "f90c2ff8-4d27-4795-806d-18c351abeb5b",
"self": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/f90c2ff8-4d27-4795-806d-18c351abeb5b",
"up": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests",
"lastModifiedSeq": 30,
"state": "READING",
"client": "786"
} |
400 NoMatchForQueryParams
404 ResourceNotFound
Request: GET /~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/f90c2ff8-4d27-4795-806d-18c351abeb5b HTTP/1.1 Host: localhost:9910 Response: Status Code: 200 OK
{
"id": "f90c2ff8-4d27-4795-806d-18c351abeb5b",
"self": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests/f90c2ff8-4d27-4795-806d-18c351abeb5b",
"up": "/~e4a954fd-5eaf-4b54-aac2-20681b33d075/requests",
"lastModifiedSeq": 31,
"state": "IN_QUEUE",
"client": "786"
} |
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/f90c2ff8-4d27-4795-806d-18c351abeb5b");
xhr.send(data); |