Time |
S |
Nick |
Message |
00:34 |
|
|
fuzzyhorns joined #rest |
04:33 |
|
|
devinclark joined #rest |
05:10 |
|
|
fuzzyhorns joined #rest |
06:11 |
|
|
fuzzyhorns joined #rest |
06:33 |
|
|
devinclark joined #rest |
07:12 |
|
|
fuzzyhorns joined #rest |
07:35 |
|
|
adaro joined #rest |
08:14 |
|
|
fuzzyhorns joined #rest |
09:13 |
|
ah |
ls -la |
09:19 |
|
trygvis |
#fail :) |
09:39 |
|
|
fuzzyhorns joined #rest |
09:55 |
|
|
rosstuck joined #rest |
10:21 |
|
|
mezod joined #rest |
10:41 |
|
|
fuzzyhorns joined #rest |
10:49 |
|
|
graste joined #rest |
11:16 |
|
|
devinclark joined #rest |
11:41 |
|
|
fuzzyhorns joined #rest |
12:42 |
|
|
fuzzyhorns joined #rest |
13:03 |
|
|
interop_madness joined #rest |
13:43 |
|
|
fuzzyhorns joined #rest |
13:44 |
|
|
fumanchu joined #rest |
14:23 |
|
|
asdf joined #rest |
14:44 |
|
|
fuzzyhorns joined #rest |
15:29 |
|
|
asdf joined #rest |
15:45 |
|
|
fuzzyhorns joined #rest |
15:56 |
|
|
devinclark joined #rest |
16:13 |
|
|
mezod joined #rest |
16:18 |
|
|
baweaver joined #rest |
16:45 |
|
|
fuzzyhorns joined #rest |
16:46 |
|
|
anth0ny joined #rest |
17:41 |
|
|
anth0ny joined #rest |
17:46 |
|
|
fuzzyhorns joined #rest |
17:47 |
|
|
anth0ny joined #rest |
18:10 |
|
|
anth0ny joined #rest |
18:47 |
|
|
fuzzyhorns joined #rest |
19:17 |
|
|
simonv3 joined #rest |
19:48 |
|
|
fuzzyhorns joined #rest |
19:55 |
|
|
bluezone joined #rest |
20:46 |
|
|
Coldblackice_ joined #rest |
20:49 |
|
|
fuzzyhorns joined #rest |
21:20 |
|
|
logikos joined #rest |
21:25 |
|
logikos |
I'm learning about REST and trying to use it when building projects. I understand that a resource should be accessed with one path and that the verbs tell the server what to do .. with the common pattern of having a list of records, and with the need to view the list, add new records, edit existing records, delete records etc. i have a question |
21:25 |
|
logikos |
say that /employee gave a list of employees and /employee/123 gave employee #123 's details |
21:25 |
|
logikos |
both GET requests |
21:26 |
|
logikos |
if i wish to edit employee 123 i would post to /employee/123 but from what uri would i get the form as /employee/123 provides a view with the employees details, but not in a form (viewer may or may not be able to edit) |
21:27 |
|
logikos |
so it seems you need 2 different GET uri's one to get the data, and one to get the form to be able to edit the data... |
21:28 |
|
logikos |
would i simply create employeeForm/123 as a way to get the form? |
21:28 |
|
logikos |
or is it expected that the server outputs the object only and the client formats it both for the view or for the form to be edited client side ? |
21:28 |
|
logikos |
which would suck... |
21:28 |
|
fumanchu |
there are several solutions |
21:29 |
|
logikos |
at least for many of the things I'm doing |
21:29 |
|
fumanchu |
1) link to a form for creating form /employee |
21:29 |
|
fumanchu |
from* |
21:29 |
|
fumanchu |
2) link to a form for editing from /employee/123 |
21:30 |
|
fumanchu |
3) return a form inside /employee/123 (the HTML way) |
21:31 |
|
logikos |
if we use option 3, and /employee/123 outputs a FORM then what URI would be used to get the detail view (not in a form) |
21:33 |
|
asdf |
no, it can return both the object representation, and the form |
21:33 |
|
fumanchu |
option 3 is to return the detail in a representation that can be POSTed or PUT to edit |
21:33 |
|
asdf |
for example, the collection+json mediatype says you can return both an "items":[...data..] key, and a "template": {...form...} key |
21:34 |
|
asdf |
(it also allows you to link the form as in the 2) above, eg. http://amundsen.com/media-types/collection/examples/#ex-item ) |
21:34 |
|
fumanchu |
another example: for my Shoji media type, the detail is the form: https://bitbucket.org/fumanchu/shoji/src/tip/spec.txt?at=default#spec.txt-842 |
21:37 |
|
logikos |
I have found it very restrictive to try to use a form to display the detail record .. forms are difficult to style and more often than not the data will be viewed without being edited than it will be edited .. so by displaying the data without the form allows us to present the detail much nicer, and reserve the form for only when an edit icon is clicked by users authorized to do so |
21:37 |
|
logikos |
I will read up about collection+json, perhaps that is a solution |
21:50 |
|
|
fuzzyhorns joined #rest |
22:50 |
|
|
fuzzyhorns joined #rest |
23:03 |
|
|
fuzzyhorns joined #rest |
23:52 |
|
|
anth0ny_ joined #rest |