GET Representation of Asynchronous Request
View how asynchronous request made to server is represented
Description
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.
The following sections use JSON as the data serialization format.
Request
HTTP Method
GET
URI
http://host:port/{request-uri-string}
Response
Success
200 OK
Name | Description | Value-Type |
---|---|---|
id | ID of a particular request. | {id-string} |
self | URI of particular request. Use the URI in other asynchronous execution requests such as retrieving the state of the request or result of 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. |
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" } |
Error
400 NoMatchForQueryParams
404 ResourceNotFound
Sample Call
HTTP
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" } |
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/f90c2ff8-4d27-4795-806d-18c351abeb5b"); xhr.send(data); |
Version History
Introduced in R2016b