RESTful API getting start & awesome resources

What & Why RESTful API?

The RESTful API consists of two main concepts: Resource, and Representation.

Resource can be any object associated with data, or identified with a URI (more than one URI can refer to the same resource), and can be operated using HTTP methods. Representation is the way you display the resource.

Refs: The Basics of REST and RESTful API Development - Hongkiat

What exactly is the REST architecture?

  • Consistency across the entire API
  • Stateless existence, i.e. no server-side sessions
  • Use of HTTP status codes where appropriate
  • Use of URL endpoints with a logical hierarchy
  • Versioning in the URL rather than in HTTP headers

Key Takeaways For RESTful APIs

  • GET for retrieving an object
  • POST for creating a new object
  • PUT for modifying or replacing an object
  • DELETE for removing an object