F
F
floppa3222018-11-01 23:45:19
API
floppa322, 2018-11-01 23:45:19

Correct type of URL for end point'a?

Suppose there is an entity "Event", which includes 4 fields: title, date, location, owner. How to "correctly" organize the URL if you need to update this structure:
1. /event/update/ and in json we pass the field name and value, for example: {"title" : "Great event", "owner" : "Karl" } .
Or put the field value in the url itself, and the value as a parameter:
2. /event/update/title/:param

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2018-11-02
@Lite_stream

1st. Even better
GET /events - list of events with filter
GET /events/:id - data of one selected event
POST /events - create new
PUT /events/:id - update event
DELERE /events/:id - delete event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question