Harish
Harish

Reputation: 3483

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 information?

Upvotes: 0

Views: 878

Answers (3)

Kalyan Raju
Kalyan Raju

Reputation: 611

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

Upvotes: 1

Amarghosh
Amarghosh

Reputation: 59461

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();

Upvotes: 1

cherouvim
cherouvim

Reputation: 31928

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?

Upvotes: 1

Related Questions