Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
15 years ago

How to configure Mock Response to accept simple HTTP POST

We have some services that are using simple HTTP POST requests to pass data. Is there any way to configure a  Mock Response (or Mock Service) to handle these?

Thanks.

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    There's no easy (or documented) way of doing this. You can set up a MockService to server static content, and you can manipulate the request and response using the OnRequest and AfterRequest scripts.

    Regards,
    Dain
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    I have been able to setup Mock Services this way for GET requests, but POST requests always want a SOAP envelope.

    I have also tried creating a dummy SOAP service, then modifying the mockRequest.requestContent in OnRequest script of a Mock Service to wrap it in the appropriate envelope, but it seems that the changed requestContent is not passed on as I always get the "missing/invalid SOAP envelope" error.