jquery - How to append Authorization in an URL? -


I might have a very old question, but ask if I have URL like $ http: //www.test Com $

and I would like to, in jQuery, the url to add authorization (username: password), URL to $ http: // username: password @ Www.test.com should be $

How do I complete it?

You can do it like this:

  $ Ajax ({type: 'GET', url: ..., Username: 'Username', Password: 'Password', Preceded: Function (Excerpt) {var base64 = $ .base64.encode ('Username' ": '+' Password '); xhr.setRequestHeader (" authorization "," basic "+ base 64);}, error: function ..., success: function ...  

});

This


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -