开发者

How to set header information

I have a piece of Java code which tries to access the header information posted by an html page.Right now I don't have the html page but I need to access the header information in the java file details.Can anyone please help me in writing a html page which sets header in开发者_StackOverflowformation?


Below is the some sample meta data tags syntax:

 <META NAME="description" CONTENT="A description of HTML 4.0's META element for metadata.">
    <META NAME="keywords" CONTENT="META, meta element, metadata">

http://htmlhelp.com/reference/html40/head/meta.html


Headers cannot be changed by a plain html file.

What you are trying to achieve though may be doable via "meta http-equiv" directives. So, what are you trying to achieve?


Since you tagged it javascript: Use an AJAX request. You can use the setRequestHeader(header, value) method of XMLHttpRequest

var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader("HeaderName", "value");
xhr.onreadystatechange = function(){};
xhr.send();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜