Override http status using CamelHttpResponseCode property

Highlighted
Five Stars

Override http status using CamelHttpResponseCode property

Hi,

I am trying to call an API through chttp component after that I have DSL I am overriding the Response using property CamelHttpResponseCode. I have used this property in DSL as

.removeHeaders("*")
.setHeader("CamelHttpResponseCode",constant(202))

But in Postman I get 200 OK instead of 202 Accepted.
so how can I override this status?

Moderator

Re: Override http status using CamelHttpResponseCode property

Hello,

Have you tried to set the Condition inside the component as

"${header.CamelHttpResponseCode} == 202"

1.png2.png

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch