I am trying to developp a REST web service for a project.
For the need of the project, I would like to know if it's possible to get the header of the REST request ? And how ?
Thank's in advance for your answer.
you can access individual headers by adding parameters in a schema editor and adding a 'header' to the Comment field.
tRESTRequest also sets the map of all the headers it receives as a context var, I don't have a studio opened right now but it will be easy to spot.
Going the schema editor route is the simplest approach
Last edited by morgan.hautman (2014-07-31 14:32:09)
Talend ESB / Java Developer
Email : firstname.lastname@example.org
Works for me OK. I have a simple job which accepts the XMl payload via POST, passes it to tLogRow and echoes back via tRESTResponse.
tRESTRequest schema is exactly the same as in your example, except that I did not put a default value.
"curl -X "Content-Type: application/xml" -H "EndpointNm: test" -d "<hello/>" http://localhost:8088"
results in tLogRow reporting:
<?xml version="1.0" encoding="UTF-8"?>
I am not getting any output while I tried to print EndpointNm in tJavaFlex. I need to get username and password from the header like http basic authentication.can anyone please suggest how can I get that.
I am attaching screen shots of error and my job.
Last edited by mounica_ch (2017-03-29 08:13:19)