Search code examples
resthttpposttalend

Talend: How can I set global variable into tREST HTTP Body?


I am developing a new REST webservice for our application.
My goal is to pass instead of the fixed date, a date that I retrieve from a database ,
but as I report in the images below the parameter does not work correctly.
While if I pass the date as per the field below the job works correctly.
Would you know how to help me. Thank you

" {
"tokenKey": "ofsodfdsnsd frrfmoic",
"dbKey": "dd_ab",
"customerKey": "lp_ProdG100",
"from":"2022-11-01",
"period": "DAY",
"profile": 1
}
"

enter image description here

enter image description here


Solution

  • Try this in your body

    "{\r\n \"tokenKey\": \"your token \",\r\n \"dbKey\": \"dbKey\",\r\n \"customerKey\": \"customerKey\",\r\n \"from\": \""+((Date)globalMap.get("row93.oggi"))+"\",\r\n \"period\": \"period\",\r\n \"profile\": 1 \r\n} "