Backend Flashcards
1
Q
What is a path parameter in a backend API?
A
A path parameter is a variable part of a URL that is used to identify a specific resource within a RESTful API.
2
Q
True or False: Path parameters are always optional in API endpoints.
A
False
3
Q
Fill in the blank: In a URL like ‘/users/{userId}’, ‘{userId}’ is an example of a __________.
A
path parameter
4
Q
Which of the following is a correct way to define a path parameter in a RESTful API? (A) /products/{productId} (B) /products?productId={productId} (C) /products/productId/{productId}
A
A
5
Q
What is the primary purpose of using path parameters in API design?
A
To uniquely identify resources and provide a clear structure for accessing them.