27

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

2 Answers 2

22

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Well I am trying to get this done using a RESTful URL that supplies the same data as JSON, XML or a file download (application/json, application/xml or text/plain). I think the correct way to use HTTP in this case is to send an Accepts header, but I think I am going to have to do something else.
There is no functional requirement. Using html form withour ajax is a more simple solution.
One requirement is - to set the Authorization headers required to use Oauth2 protected API being called on the form submit
7

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.