09-27-2022 10:35 PM
Hi,
I have a JSON like below, have to pass the value of StatusCode into HTTP Header. I am using JSON Formatter, but incase of Failure also it gives 200 with the actual code in the JSON payload. Help me in how to handle this
JSON:
{
“StatusCode”:“500”,
“StatusMessage”:“Success”
}
09-28-2022 01:03 AM
Hi @kumar25,
You can add the headers you want in the Binary header properties in the JSON Formatter snap.
In your case instead of using ‘500’ in the expression field like in the sample below, you can use $StatusCode
.
09-28-2022 04:29 AM
Hi @j.angelevski ,
I am able to get the error code in HTTP header along with that the entire message is published in the payload(as i am passing the entire input in the content of JSON Formatter).
How can i exclude statuscode field to be populated in the response.
09-28-2022 05:10 AM
You can choose what to provide in the response by changing the Content property by selecting the
StatusMessage
field from the input or you can have a Mapper snap before the JSON Formatter and map the values that you only need.
09-28-2022 05:28 AM
Thanks @j.angelevski