I am having a curl command . I want to use karate.exec function and use curl utility to issue a request and parse the response.
The following is my curl command
curl --header "router-destination-service-name: localService" --header "router-destination-service-namespace: local" -X GET "localhost:9876/echo1?zzz=123&aaa=123&yyy=123&bbb=123&xxx=123&ccc=123&www=123"
The output of the curl command is
{
"serverHostname": "localService",
"reqeustMethod": "GET",
"requestHeaders": {
"x-http2-scheme": [
"http"
],
"host": [
"172.22.0.2:8090"
],
"user-agent": [
"Vert.x-WebClient/4.4.4",
"curl/7.29.0"
],
"accept": [
"*/*"
],
"x-request-id": [
"ca7f8b95-93ce-4a64-faa8-6207cb65015d"
],
"x-http2-stream-id": [
"3"
],
"x-http2-stream-weight": [
"16"
],
"content-length": [
"0"
]
},
"requestUri": "/echo1?zzz=123&aaa=123&yyy=123&bbb=123&xxx=123&ccc=123&www=123",
"requestParams": {
"zzz": [
"123"
],
"aaa": [
"123"
],
"yyy": [
"123"
],
"bbb": [
"123"
],
"xxx": [
"123"
],
"ccc": [
"123"
],
"www": [
"123"
]
},
"requestBody": "BODY NOT SET"
}
please suggest me an example karate test , where I can issue a curl request using karate.exec() and then have the response as an object. Then I want to extract a property from the response for example requestUri or reqeustMethod and perform an assertion. I strictly want to use karate.exec(command). I dont want the normal GIVEN WHEN THEN scenarios
thank you