Forum Discussion
nmrao
Champion Level 3
There are two ways.
1. Randomly send the response with different status code.
2. Send a header in the request. Based on the header value, send the response.
For both above, you can use Dispatch as Script for better control to send the response.
1. Randomly send the response with different status code.
2. Send a header in the request. Based on the header value, send the response.
For both above, you can use Dispatch as Script for better control to send the response.
briankitt
6 years agoOccasional Contributor
Thanks for answering, but I'm still unclear on exactly how to get the status into the response.
for #1, where do I put it?
for #2, what header? I've tried what I thought it should be, but it did not work, so I must have used the wrong spelling.
- nmrao6 years agoChampion Level 3Please show your script.
- briankitt6 years agoOccasional Contributor
I don't have a script, but I found information online that said there is an option in the mock response panel where I can set the status code. I can't find that option, does that option not exist? Is a script the only way to do it?
- JHunt6 years agoCommunity Hero
You mentioned that you created a 'fault' which makes me think you might have a SOAP mockservice?
Status Code is not used in SOAP. It will only be an option for mock responses in a REST service.
Related Content
- 4 years ago
- 9 years ago