javascript - Page Redirect and set request custom request header -


i looking way redirect web app , set custom request header. manly because web app going expecting custom header user name call "remote_user" set user name to.

i exploring use of java servlet or maybe writing java script this.

var client = new xmlhttprequest();   client.open("post", "/log");   client.setrequestheader("remote_user", "user1");  window.location.href = "http://myserver.com:8080/webapp/"; 

i seeing page getting redirected don't see custom request headers

function customheader(remoteinput, userinput) {     var client = new xmlhttprequest();     client.open("post", "/log");     client.setrequestheader(remoteinput, userinput);      window.location.href = "http://myserver.com:8080/webapp/"; } 

now execute function:

customheader("something", "user42"); 

if misinterpreting question, please reply!


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -