Forum Discussion

dangelo1's avatar
dangelo1
New Contributor
17 years ago

Rest Mocking and error responses

Hi,
I have created a mock REST service by doing a script on OnRequest and  programatically redirecting the response mockRequest.httpResponse.sendRedirect('') based on the parameters I get from the original request.

This seems to work for the success condition but how do i return a specific response for a error condition.

What I noticed is that OnRequest gets fired but if there was an error on the redirect the AfterRequestScript doesn't get called. But I doubt i can use this as the request cannot be altered anymore at this point based from an older post.

1 Reply

  • dangelo1's avatar
    dangelo1
    New Contributor
    Can I somehow use the new Fault Operation setting in the Mock Service? Under what situations does this fault operation get triggered?