View Full Version : How to set a HTTP Request Header using JavaScript
lamassa45
08-29-2002, 10:43 AM
Hi all:
I have to redirect my users to another page, but before submitting the request to the Server I need to set a header on that request.
To redirect the user to this new page I'm using the
this.location = URL
code, but I was looking around to set a header in this request and could not find any tips...
Anyone?
Thanks
beetle
08-29-2002, 11:16 AM
<meta http-equiv="" content=""/>
I don't know if these apply to send or response though...and I think they are response...
lamassa45
08-29-2002, 11:26 AM
I think this is for the response, because this headers are set on the <HEAD> section of the HTML that is generated, and this are headers that are set on the browser when the browser reads the page. I need to send a header to the server I'm requesting the page from.
joh6nn
08-29-2002, 06:07 PM
can't be done with javascript. you'll need to look into a server side language for this.
lamassa45
08-29-2002, 06:47 PM
joh6nn:
I tried setting this header on the server, in an asp page, actually the page that redirects (the one with the javasript) is being generated from an asp, and i can set the header in ASP using the
Response.AddHeader
Method, the problem is that this header is not returned to the server on the next request, it is only present on the page generated by the ASP... The obvious solution would be to use a cookie, but I'm redirecting to a closed application that does not read cookies, it only reads the http headers in the request.
Any ideas on how to make this header available in subsequent requests to the server? Something like a persistent header!
Thanks
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.