TRestRequest - Full Headers

Highlighted
Six Stars

TRestRequest - Full Headers

Hi There,

I am trying to get the full headers list from a GET Rest Request.
The context variable is only containing the Attachment headers not the headers.

I can see in the code that the headers are initialized request_tRESTRequest_X

request_tRESTRequest_1.put("ALL_HEADER_PARAMS", messageContext
                    .getHttpHeaders().getRequestHeaders());


I am wondering how I can access it outside of the code, in the design.
The main reason for that is I need to retrieve a header that contains a dash (Content-Type, User-Agent) but the mapping doesn't allow field with a dash. It would be easier on the mapping windows to separate the name of the stream to the pattern to retrieve the "field", basically the comment should be enough to retrieve what ever you want
HEADER:Cookie:id_String

Cheers,

Books are the quietest and most constant of friends; they are the most accessible and wisest of counsellors, and the most patient of teachers.
--Charles W. Eliot (1834 - 1926), The Happy Life, 1896
Employee

Re: TRestRequest - Full Headers

Hi - yes - something similar to that will be supported in 6.0
Cheers, Sergey

Re: TRestRequest - Full Headers

I am using Talend 6.1.1. Where can I find how to retrieve headers with dashes?
Employee

Re: TRestRequest - Full Headers

Hi
I believe in one of the latest Talend versions you can add an alias to schema parameters representing request properties, so that the generated code compiles, but besides that all HTTP headers are available as a job context properties. Sorry, have no studio opened right now, but you can find how it is named by checking the generated code or perhaps by checking the context properties available to the upstream components
HTH, Sergey 

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

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