title: HTTP request in Angular
body: <p>I'm trying my hand at making api calls with Angular js. Unfortunately, I seem to be having some trouble. I am trying to pass a hero name into a form field and use that information to converse with my backend api. Unfortunately, I'm not getting any response data when I try to make contact. Any tips on how to make a successful call?</p>
  
  <p>Here is the controller.</p>
  
  <pre><code>vm.errorMsg = '';
  
  vm.hero = '';
  
  function getCharacter(hero) {
      $http({
          method: "GET",
          data: {
              format: 'json'
          },
          url: "localhost:8080/character/heroByName/" + hero
      }).then(function mySuccess(response){
          vm.hero = response.data;
          console.log(vm.hero);
      }, function myError(response){
          vm.errorMsg = response.statusText;
          console.log(vm.errorMsg);
      });
  }
  </code></pre>
  
  <p>Here is the form field, where you can enter a hero name.</p>
  
  <pre><code>&lt;div class="container"&gt;
    &lt;h2&gt;{{character.title}}&lt;/h2&gt;
    &lt;div class="row"&gt;
      &lt;div class="col-md-8 col-md-offset-2"&gt;
        &lt;div class="input-group"&gt;
          &lt;input type="text" class="form-control" placeholder="Wolverine" ng-model="character.hero"&gt;
          &lt;span class="input-group-btn"&gt;
          &lt;button class="btn btn-default" type="submit" ng-click="character.getCharacter(character.hero)"&gt;Go!&lt;/button&gt;
          &lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>