Запрос для получения шифрованных данных в двоичном виде.
URL-адрес запроса
https://crypto.ccs.cipher.kiev.ualocalhost:9094/api/v1/ticket/{uuid}/encryptor/data
...
Code Block | ||
---|---|---|
| ||
var xhr = new XMLHttpRequest(); var requestUrl = "https://crypto.ccs.cipher.kiev.ualocalhost:9094/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/encryptor/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(); |
...