REST MockService: mockRequest.requestContent is null for PATCH
I'm trying to log the data received in a REST Mockservice.
log.info mockRequest.path + ", received: " + mockRequest.requestContent
When I use Method PATCH i receive null in requestContent. When I switch to POST I see the data.
The request is sendt from a system I'm working on using OkHttpClient.
Im using SoapUI 5.8.0.
I've seen others ask the same question several years ago, but no answer was given.
Is this a known issue or is it suppost to work this way?
Hi JarleJ
In the version 5.8.0, it is a known limitation that the mockRequest.requestContent is null for PATCH requests in REST MockService, while it works for POST requests. This behavior has been reported in previous versions like 5.6.0 and 5.7.0 and is related to a limitation in how SoapUI handles the request body for PATCH (and similarly PUT/DELETE) HTTP methods in its REST mock services scripting.Some workarounds involve manually reading the input stream from the request object to extract the request body using Groovy scripting inside the mock.
To learn more - [SoapUI 5.6.0] mockRequest is NULL for PATCH call in REST Mock | SmartBear Community
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards