...
URL-адрес запроса
https://local.cipher.kiev.ua:9091localhost:9092/api/v1/ticket/{uuid}/ds/data
...
Code Block | ||
---|---|---|
| ||
var xhr = new XMLHttpRequest(); var requestUrl = "https://local.cipher.kiev.ua:9091localhost:9092/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/ds/data"; xhr.open("GET", requestUrl); xhr.responseType = "blob"; xhr.onload = function() { if (xhr.status == 200) { dsData = xhr.response; message = "Данные ЭЦП успешно получены."; } else { var reader = new FileReader(); reader.onload = function() { var response = reader.result; try { var jsonResponse = JSON.parse(xhr.responseText); message = jsonResponse.message; } catch (e) { message = (xhr.responseText == undefined) ? "Ошибка при получении данных ЭЦП." : xhr.responseText; } } reader.readAsText(xhr.response); } }; xhr.send(); |
...