Google News
logo
Rest API - Quiz(MCQ)
How would you configure a RESTful URL parameter that supports a search for a book based on its ID?
A)
GET /books/{id}
B)
GET /{id}/books/
C)
GET /book?id={id}
D)
GET /books?id={id}

Correct Answer :   GET /books/{id}


Explanation : RESTful URLs preferably identify resources through URL parameters as opposed to query parameters. Furthermore, the name of the collection type should precede the unique identifier of the resource, which makes GET /books/{id}

Advertisement