V
V
vrazbros2019-05-17 12:12:24
RESTful API
vrazbros, 2019-05-17 12:12:24

How to correctly implement the creation of an entity in accordance with the Rest API?

I can’t find an unambiguous answer, you need to implement the creation of a rating for a specific event that differs in id, respectively, there are two options for urls:
Post helmet on
events/{event_id}/rate data {'name' : 'value', 'value': 5}
or
events/rate data {'name':'rate 1', 'value': 5, 'event_id': 23} In
general, the question is where should the event_id be in the url or as a transmitted data array and why please?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question