GET Result of Request
检索请求结果
描述
使用 GET 方法从服务器检索请求的结果。self 字段的 URI 作为该方法的可寻址资源。
以下部分使用 JSON 作为数据序列化格式。有关如何使用 protobuf 作为 Java® 客户端 API 的数据序列化格式的示例,请参阅 检索请求的结果。
请求
HTTP 方法
GET
URI
http://host:port/{request-uri-string}/result
响应
成功
HTTP 状态代码
200 OK
主体
结果以 JSON 表示。
示例:
{"lhs":[[[17,24,1,8,15],[23,5,7,14,16],[4,6,13,20,22],[10,12,19,21,3],[11,18,25,2,9]]]} |
错误
HTTP 状态代码
404 RequestNotFound
410 RequestAlreadyCompleted
410 RequestAlreadyCancelled
410 RequestAlreadyDeleted
500 InternalServerError
示例调用
HTTP
请求: GET /~f76280c5-b94c-4cd9-8eb6-841532788583/requests/ad063314-ebda-4310-b356-59420058c17c/result HTTP/1.1 Host: localhost:9910 响应: Status Code: 200 OK
{"lhs":[[[17,24,1,8,15],[23,5,7,14,16],[4,6,13,20,22],[10,12,19,21,3],[11,18,25,2,9]]]} |
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/~f76280c5-b94c-4cd9-8eb6-841532788583/requests/ad063314-ebda-4310-b356-59420058c17c/result");
xhr.send(data); |
版本历史记录
在 R2016b 中推出