title: How to make spring security allow using rest services
body: <p>I have spring web application with spring security and I use rest services to access data. I have two questions about this.</p>
  
  <p>First, I can't make spring security to allow me to send POST http request and add something to database. I tried to permit this request but spring security still denies access. </p>
  
  <pre><code> http.authorizeRequests().antMatchers("/services/rest/registerUser").permitAll();
  </code></pre>
  
  <p>Second question, what is the best practice with securing rest services? I definitely don't want to let someone send data to database through rest services. So what is the best way to allow using services from inside of my app and restrict every other rest request?</p>