Discussion

Pegasystems Inc.
JP
Last activity: 9 Sep 2025 2:08 EDT
Constellation tips: how to reference a custom http header included in a dxapi call
When a custom http header is useful?
for example, a user make a ticket order using mobile app...the fron end server, which interact with mobile app, generate unique interaction_id for each request from mobile apps and log invocation message with the interaction_id...in some situation, the front end server will delegate end user's request to the back end server (Pega) via dx api call and append interaction_id to the custom http header...the back end server (Pega) also generates invocation log message containing interaction_id so that developers can trouble shoot by matching interaction_id in log messages in both front and back end system...
you can use below Java code to reference a custom http header included in a dxapi call.
javax.servlet.http.HttpServletRequest vRequest = (javax.servlet.http.HttpServletRequest) tools.getRequestor().getRequestorPage().getObject("pxHTTPServletRequest"); if (vRequest != null) { myHttpHeader = vRequest.getHeader("X-MyHttp-Header"); if (myHttpHeader != null) { tools.getRequestor().getRequestorPage().getProperty(".pyHTTPRequestHeaders.myHttpHeader").setValue(myHttpHeader); } }