Forum Discussion

JarleJ's avatar
JarleJ
New Member
6 months ago
Solved

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...
  • Humashankar's avatar
    3 months ago

    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