Pure JavaScript code for HTTP Basic Authentication?

The five-parameter version of the XMLHttpRequest.open method allows you to specify the username and password. (WHATWG spec)

xhr.open(method, url, async, username, password)

Leave a Comment