?????? (?????????, ticket) ???????????? ????? ??????-????????, ???????????? ???????? ??????????? ???????? ????????? (????????) ??????????? ??????? ? ??????????? ????? ???????. ??? ?????? ? ?????????? ???????????? 128-?????? ???????? ???? xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, ??? x-?????(?????) ???????????????? ??????? ??????????.
URL-????? ???????
https://localhost:9092/api/v1/ticket
?????
POST
????????? ???????
???????????
???????????? ????????? ???????
?????c????
?????
??? ?????? | Content-type | ?????????? ????????? | ?????? ??????????? |
---|---|---|---|
200 | application/json | message ticketUuid | { |
503 | application/json | message | { |
????????? JSON ??????? ??????
???????? | ??? ?????? | ???????? |
---|---|---|
message | String | ???????? ?????????? ?????????? ???????? |
ticketUuid | String | ????????????? ????????? ?????? |
?????? ???? ?? JavaScript + jQuery 2.2.4
$.ajax({ url: "https://localhost:9092/api/v1/ticket", type: "POST", dataType: "json" }).done(function (jsonResponse, textStatus, xhr) { message = jsonResponse.message; uuid = jsonResponse.ticketUuid; }).fail(function (xhr) { try { var jsonResponse = JSON.parse(xhr.responseText); message = jsonResponse.message; } catch (e) { message = (xhr.responseText == undefined) ? "?????? ??? ???????? ?????????." : xhr.responseText; } })