I'm developing an chat application using angular js and Openfire xmpp server. I need to send call Openfire REST api from angular js.
How to send Authorization in http headers in Angular.Js.
I'm developing an chat application using angular js and Openfire xmpp server. I need to send call Openfire REST api from angular js.
How to send Authorization in http headers in Angular.Js.
You can call the REST API and AngularJS with, if you use the shared key:
$http.get('http://example.org:9090/plugins/restapi/v1/users', {
headers: {'Authorization': 'y0rSharedKey'}
});
or with the base64 encoded 'username:password' like:
$http.get('http://example.org:9090/plugins/restapi/v1/users', {
headers: {'Authorization': 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='}
});