空手道:在请求JSON中将布尔值作为参数发送

时间:2019-03-12 12:02:52

标签: json karate

* def updategetPhonePref = !getPhonePref
* def mpRequestJson =
            """
            {
                "entity": '<entity>',
                "consent": {
                    "PHONE": updategetPhonePref
                },
                "notices": [{
                    "title": "policy",
                    "version": "NA"
                }],
                "source": "existing web"
            }
            """
            Given path '<entity>'
            And request mpRequestJson
            When method PUT
            Then status 200
            Examples:
                |entity  |
                |abc     |

我具有以上请求JSON,updategetPhonePref的值为布尔值。如何将其作为参数传递给请求JSON参数“ PHONE”?

0 个答案:

没有答案