jaspal singh
09/07/2023, 6:34 PM{
"request": {
"method": "GET",
"url": "/body-file"
},
"response": {
"status": 200,
"bodyFileName": "path/to/myfile.xml"
}
}
I am not sure how can I also give "bodyFileName" in the request body. As I want to give a path for my request xml file the way I have given on the response. Kindly advice. thanksAaron
09/07/2023, 7:06 PMjaspal singh
09/07/2023, 7:40 PM{
"request": {
"method": "GET",
"url": "/body-file"
},
"response": {
"status": 200,
"bodyFileName": "path/to/myfile.xml"
}
}
Aaron
09/07/2023, 7:43 PMbodyFileName
is only available to the response object. Usually, the requests would have something more specific than the entire request body that differentiate them.
Are your request bodys unique in specific ways that you can tell one request from another without matching the entire body? JSON example:
// request 1
{
"id": 1234,
...
}
vs.
// request 2
{
"id": 0987,
...
}
jaspal singh
09/07/2023, 7:45 PM{
"request": {
"method": "GET",
"url": "/body-file"
"body": "add the xml content here??"
}
Aaron
09/07/2023, 7:48 PMbodyPatterns
, but I’m not suggesting hardcoding the entire body.jaspal singh
09/07/2023, 7:49 PMAaron
09/07/2023, 7:49 PMjaspal singh
09/07/2023, 7:51 PMAaron
09/07/2023, 7:55 PM{
"request": {
...
"bodyPatterns" : [ {
"matchesXPath" : "/customers/customer/@id = \"55000\""
} ]
...
},
...
}
jaspal singh
09/07/2023, 7:56 PMAaron
09/07/2023, 8:06 PM"bodyPatterns": [
{
"matchesXPath": {
"expression": "//customers/customer/@id",
"equalTo": "55000"
}
}
]