title: How to encode URL in angularJS
body: <p>I'm trying to get the data from my Rest API controller using anuglarjs http GET request. However, the params that I need to send include "." symbol which caused the URL failed. I tried to encode it but it does not work. Here is what I did:</p>
  
  <pre><code>function getApplication($http) {
      this.getData = function(application,name) {
        return $http({
          method : 'GET',
          url : http://localhost:8080/app/rest/+ 'app/' + encodeURIComponent(name)
        }).then(function successCallback(response) {
          return response.data;
        }, function errorCallback(response) {
          console.log(response.statusText);
        });
      }
    }
  </code></pre>
  
  <p>The name param is <code>app.01.com</code></p>
  
  <p>and the URL result I got is: </p>
  
  <pre><code>GET http://localhost:8080/app/rest/app/app.01.com 406 (Not Acceptable)
  </code></pre>
  
  <p>anyone know how to encode the url so I can get the data from Rest Controller?
  Thanks</p>