Is it possible to rewrite the status code from a response?
My backend service returns a 202, but the requester only accepts 200 as an actual success.
Because of that, I want to rewrite the response status code from 202 to 200.
I tried the Mocking policy, but that one will not call the backend services.
I also tried the Groovy Policy in the following way:
if(response.status == 202) {
result.state = State.SUCCESS;
result.code = 200
result.error = '{"message":"ok"}'
result.contentType = 'application/json'
}
But that one also gives me the original 202 http status code.