title: angularjs $http.post with parameters
body: <p>I'm new at angular and if my question is kinda low lvl dont be angry with me. </p>
  
  <p>I have web service which returns sessionId and login success message if user will pass auth. for example url is that:</p>
  
  <blockquote>
    <p><a href="http://localhost:8181/login?username=USERNAME&amp;password=12345" rel="nofollow">http://localhost:8181/login?username=USERNAME&amp;password=12345</a></p>
  </blockquote>
  
  <p>and here's my response:</p>
  
  <pre><code>{"sessionId":"0997cec2a8b34c84ba8419ab1204e6aa","loginSucceeded":true}
  </code></pre>
  
  <p>here's my login controller:</p>
  
  <pre><code>app.controller('loginCtrl', function($scope, loginService){
      $scope.login=function(user){
          loginService.login(user);
      }
  });
  </code></pre>
  
  <p>and here's my service:</p>
  
  <pre><code>app.factory('loginService', function($http){
      return{
          login: function(user){
              var $promise=$http.post('http://localhost:8181/login?', user);
              $promise.then(function(msg){
                  if(msg.loginSucceeded=="true")
                      console.log("opa")
                  else
                      console.log("den");
              });
          }
      }
  });
  </code></pre>
  
  <p>and I have user.username and user.password in my scope (using textboxes).</p>
  
  <p>How can I pass those parameters in url and how can I parse that response?</p>