Override http status using CamelHttpResponseCode property

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

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download