I am trying to get the content of HTTP PUT request (take text from request body) to compose dynamic response in REST Mock Service.
mockRequest.requestContent is always NULL if PUT method is used although request is sent with some text in request body and Content-Length is set with appropriate value in HTTP headers.
If HTTP action is changed to POST then mockRequest.requestContent is populated correctly.
Unfortunately, this is a bug. There is an internal defect of SOAP-2344 for this issue. This applies for the PUT and DELETE methods for a REST mock service.
The workaround works smoothly. However, if you need re-get the content down the road, you can’t since the stream cannot be consumed twice. Hope there’s a real solution from smartbear.
Originally posted by vikititor on November 11, 2019
NOT WORKS. I am using the ReadyAPI v 2.8.
I am unable to read request body.. So unable to return valid response to my Application under test = I am unable to test it = unable to use this tool for testing.
This topic is here sooo loooong.. And no solution? I am surprised. So nobody from SmartBear was working on it? It means, that we are paing for licenses, but no effect?
Please can somebody tell me, how to read POST body request ? because I must return some string value from it back to AUT..
Originally posted by AlexKaras on November 14, 2019
Hi,
Have you seen my reply here: https://community.smartbear.com/t5/Service-Virtualization-Virtual/how-MOCK-read-request-data-from-attachement/m-p/193441/highlight/true#M692 ?
Does it help?