Câu hỏi phỏng vấn API Design
Câu hỏi

Mention what are resources in a REST architecture?

Câu trả lời

In a REST architecture, resources are fundamental elements that represent any kind of data or functionality that can be accessed and manipulated through the API. Here are the key points to mention about resources in a REST architecture:

  1. Definition and Identification:

    • A resource is any piece of information that can be named and manipulated, such as a user, a product, an order, or even a document like an HTML page or an image[1][2][3][4].
    • Resources are uniquely identified by Uniform Resource Identifiers (URIs). For example, a user resource might be identified by the URI /users/123, where 123 is the unique identifier for a specific user[2][3][6].
  2. Representation:

    • Resources are represented in various formats such as JSON, XML, HTML, plain text, etc. The representation format is typically chosen based on the needs of the client and server, and it can be specified using HTTP headers like Accept and Content-Type[1][2][3][4].
    • The representation includes the data of the resource and metadata that describes how to process the data[2][3].
  3. Manipulation through HTTP Methods:

    • Resources are manipulated using standard HTTP methods:
      • GET: Retrieve a representation of the resource.
      • POST: Create a new resource.
      • PUT: Update an existing resource.
      • DELETE: Remove a resource[2][5][6].
  4. Stateless Interactions:

    • Each interaction with a resource is stateless...
junior

junior

Gợi ý câu hỏi phỏng vấn

middle

What are the best practices for caching?

senior

What is difference between SOA and Web Services?

expert

Name some best practices for better RESTful API design

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào