Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <script>
    var apiBase = "http://test.servicestack.net";
    var app = angular.module('app', []);
    app.run(['$rootScope', '$http', '$timeout', function ($rootScope, $http, $timeout) {  
      $rootScope.success = "running...";
      $http
         .post(apiBase + '/auth/credentials', 
               { "UserName": "test", "Password": "test" }, 
               { withCredentials: true })
         .success(function (data) {
           $rootScope.success = "Login successful. Result: " + JSON.stringify(data);
         })
         .error(function (data, status, headers, config) {
           $rootScope.error = 'ERR:login';
         });
    }]);    
  </script>
</head>
<body>
  <div style='color:green'>{{success}}</div>
  <div style='color:red'>{{error}}</div>
  
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers