title: AngularJS: How do I handle RESTful APIs with token security and custom methods?
body: <p>So say I have a <strong>RESTFul API</strong> that has the standard <code>GET</code>, <code>POST</code>, <code>PUT</code>, and <code>DELETE</code> methods on it, but I also have other methods on it that are custom to specific object types, and on top of that I require a security token.</p>
  
  <p>so a URL for this service might look like this:</p>
  
  <p><strong>GET/PUT/POST/DELETE</strong> <a href="http://sample.com/api/User/123?token=ABCDEF1234" rel="nofollow noreferrer">http://sample.com/api/User/123?token=ABCDEF1234</a> </p>
  
  <p>and </p>
  
  <p>GET <a href="http://sample.com/api/User/GetUsersByStatus?token=ABCDEF1234&amp;param1=blah&amp;param2=foo" rel="nofollow noreferrer">http://sample.com/api/User/GetUsersByStatus?token=ABCDEF1234&amp;param1=blah&amp;param2=foo</a></p>
  
  <p>or</p>
  
  <p><strong>POST</strong> <a href="http://sample.com/api/User/DoSomethingCrazy?token=ABCDEF1234" rel="nofollow noreferrer">http://sample.com/api/User/DoSomethingCrazy?token=ABCDEF1234</a></p>
  
  <p>where the last two do some custom functionality. Maybe it's something to reset a password, or maybe it's something to clone a user and return the record, I don't know. Just custom "stuff".</p>
  
  <p>What is the best-practice way to handle this with Angular? I've seen the $resource utility, but it seems to only be for the standard <strong>REST</strong> methods, and I'm not sure how to extend that in a way that the next Angular developer will understand.</p>