Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom HTTP Request headers in HTML

Tags:

Does anyone know if its possible to send out custom http REQUEST headers in HTML without having to use javascript (no xhr wrapper).

Would it be possible to define them as meta tags within the head? Or may they be defined in the form somewhere?

<meta http-equip="x-something-custom" name="custom value" /> 

this works, however, this is a RESPONSE header. What I need to set a REQUEST header.

I'm not looking for setting hidden fields in forms, but actual raw http header manipulation with html tags.

Is this possible?

like image 246
matsko Avatar asked Jun 15 '10 17:06

matsko


People also ask

Can an HTTP request have custom headers?

Custom HTTP headers can be used to filter requests or specify a value for the Accept header.

How do I create a request header in HTML?

In the Name field, enter the name of your header rule (for example, My header ). From the Type menu, select Request, and from the Action menu, select Set. In the Destination field, enter the name of the header affected by the selected action. In the Source field, enter where the content for the header comes from.

How do I send a custom request header?

Custom Headers are for troubleshooting, informational purposes, and specific server-side logic. For example, to send a GET request with a custom header name, you can use the "X-Real-IP" header, which defines the client's IP address. For a load balancer service, "client" is the last remote host.

How do I pass HTTP header in HTML?

HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its case-insensitive name followed by a colon ( : ), then by its value. Whitespace before the value is ignored.


2 Answers

Does anyone know if it's possible to send out custom HTTP request headers in HTML without having to use JavaScript?

No, it's not possible.

What is it, the functional requirement for which you think that this is the solution? Elaborate that, then we may be able to come up with a suitable solution.

like image 64
BalusC Avatar answered Oct 14 '22 03:10

BalusC


Why do you need to set something in the header?

If it's for testing you can use a Firefox extension or a web proxy to manipulate the header.

Otherwise, it cannot be done from HTML.

like image 37
Ben S Avatar answered Oct 14 '22 03:10

Ben S