Adding http request header to a a href link [dupli

2019-01-14 21:01发布

This question already has an answer here:

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.

标签: html http
2条回答
乱世女痞
2楼-- · 2019-01-14 21:41

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

查看更多
淡お忘
3楼-- · 2019-01-14 22:00

Can you elaborate on what you are trying to do?

I don't believe it's possible to specify a request header via a link. You can send GET parameters to the target site with the following notation:

www.google.com?q=searchterm

The first GET parameter is separated from the URL by a question mark (?) after that each additional parameter should be separated with an ampersand (&) like so:

www.google.com?q=searchterm&otherparam=value&otherotherparam=value
查看更多
登录 后发表回答