Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding http request header to a a href link [duplicate]

Tags:

html

http

I have a simple href link from some html

<a href="www.google.com">Apparently you can find things here</a>  

But I want to add a http request header to the request?

Is this possible.

like image 430
More Than Five Avatar asked Apr 05 '13 13:04

More Than Five


People also ask

Can HTTP headers be duplicate?

The HTTP header Connection is overwritten, but allowed to have duplicates and multiple values. The HTTP headers Host and Expires are overwritten and not allowed to have duplicates and multiple values. The HTTP header Date is overwritten and allowed to have duplicates but not allowed to have multiple values.

Can you have multiple HTTP headers with the same name?

A recipient MAY combine multiple header fields with the same field name into one field-name: field-value pair, without changing the semantics of the message, by appending each subsequent field value to the combined field value in order, separated by a comma.

Can you add header to URL?

You don't. You can't set HTTP headers as part of URL, it's not the way it works. At best you may be able to use a browser plugin to add/set arbitrary HTTP headers, but that will depend on the browser you are using. And will be a one off test/development option.


1 Answers

There is no way for a page to specify HTTP request headers other than for requests made using XMLHttpRequest and fetch.

like image 129
Quentin Avatar answered Sep 20 '22 03:09

Quentin