How to pass HTTP AUTH values โ€‹โ€‹through Ajax.Request () prototype?

Is there a way to pass the HTTP username and password to AUTH along with Ajax.request ()? Basically, I'm trying to find the equivalent:

curl user:pass http://url.com 

It seems to be accessible, but I can't figure it out. If not, is there any other alternative to JS?

+4
source share
2 answers

I'm not sure about the prototype, but you can pass the username and password as the fourth and fifth arguments to the base open XmlHttpRequest method, as shown here .

+3
source

I know that someone wrote a custom extension for the ExtJs library that provides configuration options for basic authentication in standard Ajax requests and automatically processes Base64 encoding.

http://extjs.com/forum/showthread.php?t=21681

0
source

All Articles