EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only

set http headers from rich ui

  • 1.  set http headers from rich ui

    Posted Mon April 16, 2018 03:34 PM

    Hello,

     

    I would like to set http request headers from rich ui. However it seems that servicelib.setRestRequestHeader applies to the headers inside the json request payload and not to the http headers (such as 'Accept', 'User-Agent' etc see https://en.wikipedia.org/wiki/List_of_HTTP_header_fields for a complete list).

     

    When I edit the generated html in the Deployed Web Project and add the following line: 

    xhr.setRequestHeader("User-Agent","Chrome/65.0.3325.181");

    after the generated line:

    xhr.open("POST",_bd,_b9)

    it works perfectly.

     

    So now the question is: How I can embed xhr.setRequestHeader(header, value) to my egl code? I tried using External Type for Javascript code but I could not manage to reference the xhr object.

     

     

     

     

     

     

      

    chp21