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
Post a Comment