dangelo1
17 years agoNew Contributor
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.
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.