7
7
700ghz2019-01-17 11:43:02
API
700ghz, 2019-01-17 11:43:02

Correct URI acc. with REST API?

Hello! :)
The shops have books.
POST BOOK: /shops/{shopId}/books<- everything is clear here
How the URI for deleting a book from the database will look right (according to REST):
1) DELETE BOOK: /shops/{shopId}/books/{bookId}<- extra id (shopId), but the URI shows the structure
2) DELETE BOOK: /books/{bookId}<- nothing extra in the URL, but different from the POST request See above
How to make this URL correct? Is the extra id in the URI critical?
Thank you! :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Okhotnikov, 2019-01-17
@700ghz

I understand that the book is received at the address via GET
In this case, the deletion will be at the same address, but via DELETE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question