This may have to do with the fact the the browser will first make an 
OPTIONS http request without the basic auth credentials.  If your api 
doesn't handle OPTIONS without the credentials, then the request fails.  I 
ran into this issue (not with Angular but with a jQuery page where we 
needed basic authentication).

Here's a post that illuminated it a little: 
 
http://stackoverflow.com/questions/9692067/jquery-ajax-calls-with-http-basic-authentication

I could be wrong, but this is one thing to consider.

On Sunday, March 16, 2014 3:29:24 AM UTC-6, Ramanand Chitravelu wrote:
>
> As given in the documentation i am trying to set a authorization header on 
> my config 
>  $httpProvider.defaults.headers.common['authorization'] = 'Basic 
> aG9zdDpwYXNzd29yZA==';
>
>
> <https://lh6.googleusercontent.com/-7irvCksgu0s/UyVu3hf6lII/AAAAAAAADl0/1x23CQNKKjY/s1600/Screenshot+from+2014-03-16+14%3A58%3A36.png>
> console.log prints my header but i cant see any request header going on my 
> chrome console.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to