Wednesday, May 16, 2012

Base64 encoding in Sproutcore

I need to invoke restful webservices in Sproutcore which requires authentication header for http request. I write a code like in Sproutcore:



authHeader: function () {
var userAndPass = "username:password";
var auth = "Basic " + Base64.encode(userAndPass);
return auth;
},


However, when I run it, sadi Base64 is not defined.



Anybody knows how to fix it or do it in sproutcore. Thanks





No comments:

Post a Comment