• Representational State Transfer Application Programming Interface

  • Architectural style that allows different software applications to communicate with each other over the internet using HTTP protocol

  • Treats data as resources (user, product. image)

    • Identified by unique URLs (Uniform Resource Locators)
    • Manipulate using standard web verbs
    HTTP Method CRUD Action Purpose Example Endpoint
    GET Read Retrieves data from the server. GET /users/123
    POST Create Submits new data to create a resource. POST /users
    PUT Update Replaces an entire existing resource. PUT /users/123
    PATCH Update Partially updates a specific resource field. PATCH /users/123
    DELETE Delete Removes a specific resource from the server. DELETE /users/123
  • To be true “RESTful” API, must follow core constraints

    • Statelessness
      • Server stores no context about client session
      • Each request must contain all information required to process it
    • Client-Server Separation
      • User interface (client) and data storage (server) manage tasks independently
      • Lets both sides scale separately
    • Cacheability
      • Server responses must specify whether the data can be cached by the client to improve app speed
    • Uniform Interface
      • Resources must be consistently named using logical URLs
      • Data is transferred via standard formats, most commonly JSON (JavaScript Object Notation) due to its readable format
      • Layered System
        • Client cannot tell if its connected directly to the end server or an intermediary such as a load balancer or security gateway