Forum Discussion

martinh3345's avatar
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() "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


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





1 Reply

  • oislas's avatar
    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