Hello,
I was wondering if there is a way to change the HTTP Status of the response returned by the Route via HTTP assertion. Just like how you can use the Manage Transport Properties/Headers to add or modify existing headers. I would like to keep everything about the response as is but only change the status code.
Thanks.
Hi Guzman,
You can test using the Return Template Response to Requestor assertion that allows you to modify the Response status. To get the body of the response in a context variable:
Hi Mohindra,
I did consider this but I couldn't get the existing headers preserved with this. As you can see this only sets the Content Type header.
Thanks for the reply.
That's right, the headers will not be passed. You can store the ${response.http.allheardervalues} to a multivalued context variable.Use the For Each Item Assertion to parse the array with the Manage Transport Properties/Headers Assertion to send the headers.
${<target>.http.allheadervalues}
Returns all HTTP headers and values in an array, in the format "<name>:<value>".
Thanks Mohindra. That is helpful.
Are you able to modify the response status code?
I have a similar requirement to send status code with status-line/message (like "invalid field").
Please confirm.