[resolved] Get header information from tRestRequest
Hello, 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.
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.
Doing:
"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"?>
<hello/>|test
Cheers, Sergey
Hi,
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
HTH, Sergey
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.
Doing:
"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"?>
<hello/>|test
Cheers, Sergey
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.