user1717230
user1717230

Reputation: 453

How to specify more than 1 content type for a mule inbound endpoint

We use mule in which we deploy some of our services.

For one of our service, the input can either be application/xml or application/json. How can i specify multiple content types for the same inbound endpoint.

This is how we had it when we had just one content-type to deal with.

<https:inbound-endpoint address="https://localhost:43123/v1/cars"
            exchange-pattern="request-response" contentType="application/xml">
            <mule-ss:http-security-filter realm="mule-realm" />
        </https:inbound-endpoint>

how do I specify that the above inbound point should be able to handle content types of 'application/xml' and 'application/json'

Upvotes: 0

Views: 1090

Answers (1)

David Dossot
David Dossot

Reputation: 33413

The contentType attribute doesn't have any effect on inbound HTTP endpoints.

Just remove it and check the actual content type in the inbound property named http.headers with an expression like: #[message.inboundProperties['http.headers']['Content-Type']]

Upvotes: 3

Related Questions