如何提取空手道中有冒号的 json 键
How to extract json key having colon in karate
响应如下:
{
"result": "SUCCESS",
"_links": {
"payment:cancel": {
"href": "http://myhost:8080/12345"
}
}
}
我试过以下:
* def value = Response._links.payment:cancel.href
请帮助如何获取“payment:cancel”的值
给你:
* def response =
"""
{
"result": "SUCCESS",
"_links": {
"payment:cancel": {
"href": "http://myhost:8080/12345"
}
}
}
"""
* def value = response._links['payment:cancel'].href
* match value == 'http://myhost:8080/12345'
响应如下:
{
"result": "SUCCESS",
"_links": {
"payment:cancel": {
"href": "http://myhost:8080/12345"
}
}
}
我试过以下:
* def value = Response._links.payment:cancel.href
请帮助如何获取“payment:cancel”的值
给你:
* def response =
"""
{
"result": "SUCCESS",
"_links": {
"payment:cancel": {
"href": "http://myhost:8080/12345"
}
}
}
"""
* def value = response._links['payment:cancel'].href
* match value == 'http://myhost:8080/12345'