Spring 4 REST Best Practices


  • Base URI design 
  • Versioning 
  • Paging, Searching, Partial data 
  • Message 
  • Timestamp

URI Design

URL design Recommendations 

  • Use nouns (don't use verbs) 
    • GET: /customers (good) 
    • GET: /getCustomers (bad) 
    • GET: /customers/:id (good) 
    • GET: /customers/retrieve/:id (bad) 
    • POST: /customers/:id (good) 
    • POST: /customers/new (bad)
  • Make it simple – short, easy to use, easy to understand 
    • /customers 
    • /customers/{id} 
    • /customers/{id}/orders 
    • /customers/{id}/orders/{order-id} 
  • User plural than singular 
    • HTTP GET: /customers (good) 
    • HTTP GET: /customer (bad)

You must have an active subscription to download PDF and Lab Zip of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.