J
J
Jake Taylor2021-11-07 15:17:23
Spring
Jake Taylor, 2021-11-07 15:17:23

What should a GET request look like in Spring REST?

There are two entities:
- User (user)
- Gift_certificate (gift certificate)
- Order (gift certificate order)

This is how the tables in the database look like:
6187c38d3e3a5640943770.png

What should the GET request look like in the Spring controller for the condition to get information about the user's order?

My options:
- /orders?user_id=1&order_id=1
- /orders/1/user_id=1
-/users/1/order_id=1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-11-07
@n199a

All options are wrong. The user ID should not appear in the URL at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question