title: AngularJS DELETE request to my REST webservice is in plain text?
body: <p>So I am trying to wire up an AngularJS front-end to a Java Spring back-end using a REST service.</p>
  
  <p>My DELETE requests keep getting the following error (notice the speaker?id=) - Why is it generating speaker?id= instead of speaker/ ?</p>
  
  <pre><code>DELETE http://localhost:8082/rest/speaker?id=54200b6b772f1e7b0688307b 405 (Method Not Allowed) 
  </code></pre>
  
  <p>The code is as follows:</p>
  
  <p>Java:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.DELETE, value = "/{id}")
  public void delete(@PathVariable String id) {
      speakerService.delete(id);
  }
  </code></pre>
  
  <p>Angular JS service</p>
  
  <pre><code>this.delete = function (id, callback) {
  
      SpeakerResource.delete({ id: id }, function () {
          callback();
      });
  
  }
  </code></pre>
  
  <p>Angular JS factory</p>
  
  <pre><code>app.factory('SpeakerResource', function ($resource) {
  return $resource('rest/speaker/:speakerId',
      {
          speakerId: '@speakerId'
      },
      {
          'update': { method: 'PUT' }
      },
      {
          'delete': { method: 'DELETE', params: {id: '@speakerId' } }
      }
  </code></pre>
  
  <p>If I use the $http statement then everything works correctly, but obviously I'd like to stick to using the factory as the PUT/POST methods are working fine!</p>
  
  <pre><code>    $http.delete('http://localhost:8080/rest/speaker/' + data.id);
  </code></pre>
  
  <p>Cheers,</p>