Discussion

1
Replies
2150
Views
Close popover
Jose Navas (josenavas)
Hoverstate
Jose Navas
Hoverstate
SV
josenavas Member since 2013 37 posts
Hoverstate
Posted: February 22, 2016
Last activity: February 23, 2016
Closed

Send custom HTTP header

Hi,

We have a requirement to send a custom header for authorization, for example a header with name "token". This needs to work seamlessly together with the action "Open URL in Window" that is available for links in a Repeat Grid.

We've tried adding a extra action "Run Activity" before the Open URL in Window, that will run an activity with this Java code:

String token = "";
String authToken = "$2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a";
client = org.apache.http.impl.client.HttpClients.custom().build();
org.apache.http.client.methods.HttpUriRequest request = org.apache.http.client.methods.RequestBuilder.get().setUri(DocumentURL).setHeader(token, authToken).build();
response = client.execute(request);

Like you see in the code above, we set the custom header with "setHeader(token, authToken)", but once we click the link, we notice* the custom header is not being passed over to the DocumentURL we specified...

*We used Firefox's Live HTTP headers extension to monitor the header information that is being sent over

Since I think Pega 7.1.8 does not have a OOTB way to send custom HTTP headers... Any idea for a workaround for this problem?

Thanks,

Jose

 

 

 

Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion.