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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: Path parameters are always optional in API endpoints.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fill in the blank: In a URL like ‘/users/{userId}’, ‘{userId}’ is an example of a __________.

A

path parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly