beginnerREST Fundamentals

What is a resource, a sub-resource, and a URI in REST API design?

A resource is any entity a client can interact with — a user, an order, a product — identified by a unique URI like /users/42. A sub-resource represents something that only exists in relation to a parent resource, expressed as a nested path, e.g. /users/42/orders for the orders belonging to user 42. The URI itself is the resource's address; well-designed REST APIs use nouns in URIs (resources) and HTTP verbs (actions) rather than encoding actions into the URI path.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What is a resource, a sub-resource, and a URI in REST API design?

Next Step

Continue to What are the main HTTP methods used in REST APIs, and what does each represent?← Back to all Spring Boot & Microservices questions