Custom HTTP Request headers in HTML

2019-01-15 13:11发布

问题:

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?

回答1:

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.



回答2:

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.