Ask HN: How do you add headers in href of an a tag/link?

3 points by alegeaa ↗ HN
Hello hackers,

I am stuck on this and I have tried all possible channels available to me. I thought maybe I can find some help here.

So, there is an API endpoint requires a token (API key). However, the full link of the API is meant to be added in the third party app and be opened in the client`s browser while also passing the header information.

For example, the API link is x.com/do_this

the client (of the API) adds the link in their application. When the client`s user clicks the link, it should open x.com/do_this but the client`s API key is needed to show some information when that link is opened.

How do I go about this? I dont mind using AJAX, JS, or any other tech out there that can provide this solution.

Thanks

2 comments

[ 3.4 ms ] story [ 18.6 ms ] thread