Hello,
I want get Content-Type from Header but in Request from client is application/json but after to convert json to xml the content-type change but i want take the first content-type the Request from client.
Thanks.
Hi @Josh iQu
You can store the header in a flow variable using Assign Message policy
<AssignVariable> <Name>reqContentType</Name> <Ref>request.header.Content-Type</Ref> </AssignVariable>
and use this where ever you want. Make sure this policy executes before the JSON to XML policy
Same can be done using extract variable policy as well. Both work, question is when to use which ? Any recommendations ?
Doesn't matter. Choose which feels right to you.
ExtractVariable I think of as a thing that "Extracts" information from some larger set.
AssignVariable with the Ref element is just a simple way to copy the state of a variable. I prefer that. Your preference might be different.
User | Count |
---|---|
5 | |
2 | |
2 | |
1 | |
1 |