Forum Discussion
Yes we have done the same and found the solution for the above approach.
In binary router we are validating the JSON or XML input streams and then doing our further works.
Thanks for your attention.
We did the same, when we tested with a FIle Reader snap and specified a file from SLDB, we found that the field we need to check is ‘x-amz-meta-mimetype’. When we remove the File Reader snap, create a task and use postman… the input does not have this field. We tried using content-type and this fails too… Could you please provide what the conditions in the router were?
- tstack7 years agoFormer Employee
Do you mean a Triggered Task? The Content-Type header for a POST (and a few others) come in as pipeline parameters. To get the Content-Type, you’d use:
_CONTENT_TYPE
- mina5 years agoEmployee
Hi for me it didn’t work due to on postman, Headers Content-Type was set to the default
application/x-www-form-urlencoded. After I changed it to
text/csv or application/json depending on the file I chose,
and on the Binary Router snap, I did
$
[“content-type”]==“text/csv”
$
[“content-type”]==“application/json”
the Post then worked as expected.- pjanapati3 years agoNew Contributor II
Hi @mina ,
In previous reply, you have mentioned like through router snap using content-type field routed the data. I am trying to route the data based on content-type. But I didn’t get the content-type. Can you please help me with this. How to get that content-type data?
Thanks in advance.