Forum Discussion

martinh3345's avatar
martinh3345
New Contributor
4 years ago

[SoapUI 5.6.0] mockRequest is NULL for PATCH call in REST Mock

I currently have mock services setup for a few different methods (GET, POST, PATCH). I am trying to build dynamic responses via the Script option and have this working successfully for my GET and POST calls, however I am unable to get my PATCH call working in this way and I'm wondering if this is a limitation of the software.

 

At present the only script applied on the PATCH /orderMetadata data call is to try and capture the request body...

 

// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody

 

I have the following OnRequest scripts running on the solution as per the screen shot below however I cannot capture the request body being passed in

 

log.info(mockRequest.getRequestContent())
log.info(mockRequest.getPath())

 

Below shows the log script log for a POST /orderMetadata call and a PATCH /orderMetadata call both called with the same request body, the POST is working successfully (note - this has the same script applied as the PATCH) whereas the PATCH is null. Is this an issue with using PATCH? Are there any other commands that would capture the request body so I can branch on this? 

 

Note - I have tried renaming the PATCH /orderMetadata call to differentiate it from the POST but this made no difference

 

Thanks

 

 

1 Reply

  • oislas's avatar
    oislas
    New Contributor

    The same error is still present in version 5.7.0, the requestContent for PATCH requests arrives in null, both in the OnRequest Script and in the Operation Script