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.

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

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

Getting Started with APIs

Find out how to get started with APIs

Read