'Basic Authentication Header in Web browser

I need to access a website that requires basic authentication. I understand how HTTP/S-requests can contain headers, but how does this work for websites? I've tried to pass the basic authentication in the URL, but that doesn't work.

Should I be passing the basic authentication header in JavaScript or something?

Here's what I've tried

https://username:[email protected]/
https://website.com/?authMethod=Basic&authUsername=username&authPassword=password


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source