angularjs - Angular 1.6 sends OPTIONS instead of POST -


i'm trying basic authentication rest api using angularjs in console i'm getting possibly unhandled rejection. , on server

"options /api/users http/1.1" 301 0

app.factory('api', ['$resource', '$base64', function ($resource, $base64) { function add_auth_header(data) {      return 'basic ' + $base64.encode(data.username + ':' + data.password); }  return {     auth: $resource('127.0.0.1:8000/api/users/', {}, {         login: {method: 'post', headers: { 'authorization': add_auth_header }},         logout: {method: 'delete'},     }) }; }]) 

my headers


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -