This example constructs a create form for use to create a resource on a collection. This example creates a todo item on a todo list. Navigate to this resource from the home via the ‘me’ > ‘todos’ > pick a todo list > ‘todos’.
create-form
linkMethod | link rel | associated route | notes |
---|---|---|---|
GET | /todo/{id}/todo/ | add
create-form
as a link rel to collection |
|
GET | create-form |
/todo/form/create | follow the
tenants
link to get the collection |
POST | self |
/todo/{id}/todo/ | fill in the form and send back to collection. Response returns
201 Created
with
Location
header |
GET | /todo/{id} | follow the
Location
header returns a filtered search (feed) collection. Note: this is the same route as
tenants
link rel |
Note: by convention a form can be submitted semantically. Here, because there is
submit
link rel on the form, the forms is send back to the ‘self’ rel on the originating collection resource.
Below, you see on overview of the code, then you see the implementation.
Below, you see on overview of the code, then you see the implementation.
Below, you see on overview of the code, then you see the implementation.