Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

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?

Highlighted
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.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now