cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to find the incoming data format (like json or xml) dynamically

pjanapati
New Contributor II

Hi everyone,

I am passing the data from postman and I need to route the data based on the incoming data whether it is json or xml. Based on this, I have to do the other logics. So my issue was, how to find the incoming data format? For this I have tried some ways but those are not worked for me. Can you please anyone help me with this.
Thanks in advance.

5 REPLIES 5

koryknick
Employee
Employee

Here is a sample pipeline using the Binary Router and the $[โ€˜content-typeโ€™] binary header.
SimpleAPI_2023_04_26.slp (11.6 KB)

Here also is a screenshot of the JSON call:
image

image

I tested and this also works with application/xml as Content-Type and XML content in the body.