I would return an empty collection. A product with zero orders is a completely valid concept, so the existence of an empty orders collection makes more sense than a 404 which would infer that this product does not have a orders collection.
Related Contents:
- What is RESTful programming?
- Best practices for API versioning? [closed]
- RESTful Authentication
- Representational state transfer (REST) and Simple Object Access Protocol (SOAP)
- Hyphen, underscore, or camelCase as word delimiter in URIs?
- If REST applications are supposed to be stateless, how do you manage sessions?
- When do I use path params vs. query params in a RESTful API?
- How to download excel (.xls) file from API in postman?
- Transactions across REST microservices?
- Security of REST authentication schemes
- REST Complex/Composite/Nested Resources [closed]
- Design RESTful query API with a long list of query parameters [closed]
- Transactions in REST?
- What REST PUT/POST/DELETE calls should return by a convention?
- Should a Netflix or Twitter-style web service use REST or SOAP? [closed]
- How useful/important is REST HATEOAS (maturity level 3)? [closed]
- Amazon S3 Change file download name
- How to construct a REST API that takes an array of id’s for the resources
- REST API DESIGN – Getting a resource through REST with different parameters but same url pattern
- How do you manage the underlying codebase for a versioned API?
- How is GRPC different from REST?
- What is the difference between @PathParam and @QueryParam
- How do streaming resources fit within the RESTful paradigm?
- REST api: requesting multiple resources in a single get [duplicate]
- Convention for HTTP response header to notify clients of deprecated API
- Groovy built-in REST/HTTP client?
- Where can I find jenkins restful api reference? [closed]
- What are the pitfalls of using Websockets in place of RESTful HTTP?
- HTTP Status 424 or 500 for error on external dependency
- HATEOAS: absolute or relative URLs?
- Querystring in REST Resource url
- Passing array in GET for a REST call
- Should a RESTful API return 400 or 404 when passed an invalid id
- What are the DAO, DTO and Service layers in Spring Framework?
- Is using a verb in URL fundamentally incompatible with REST?
- S3 REST API and POST method
- How to combine websockets and http to create a REST API that keeps data up to date? [closed]
- Making a PowerShell POST request if a body param starts with ‘@’
- What is the gold standard for website APIs? Twitter, Flickr, Facebook, etc [closed]
- ASP .NET MVC 4 WebApi: Manually handle OData queries
- HATEOAS: concise description
- What is the difference between a HTTP-Get and HTTP-POST and why is HTTP-POST weaker in terms of security
- Reusing DTO for various request/response types vs explicitness of what is required / what should be returned [closed]
- Avoid duplicate POSTs with REST
- “404 Resource Not Found” From Azure Blob Storage Document from PUT
- Including Id in URI for PUT requests
- REST Media type explosion
- Free Rest API to retrieve current datetime as string (timezone irrelevant) [closed]
- what is hypermedia , hypermedia controls, hypermedia formats
- REST URL design for greater than, less than operations