Time |
S |
Nick |
Message |
00:45 |
|
|
tbsf joined #rest |
01:59 |
|
|
Coldblackice joined #rest |
02:06 |
|
|
tbsf joined #rest |
02:58 |
|
|
quimrstorres joined #rest |
06:12 |
|
|
daxim joined #rest |
06:45 |
|
|
HermanToothrot joined #rest |
06:56 |
|
|
Coldblackice joined #rest |
06:58 |
|
|
quimrstorres joined #rest |
07:01 |
|
|
wsieroci joined #rest |
07:15 |
|
|
DevAntoine joined #rest |
07:28 |
|
|
interop_madness joined #rest |
09:20 |
|
|
anth0ny joined #rest |
09:46 |
|
|
timg___ joined #rest |
10:58 |
|
|
sz332 joined #rest |
10:59 |
|
|
sz332 left #rest |
11:11 |
|
|
sz332 joined #rest |
11:11 |
|
sz332 |
morning guys |
11:11 |
|
sz332 |
question about REST path development (just because so many clever guys are here) how would you solve the following: we have users. To users we can assign or deassign cats from a predefined list. We would also know which cats are assigned, and which are not. How would a preferred rest api path look like? GET /users/{id}/cats/current, GET /users/{id}/cats/available, POST /users/{id}/cats/assign, POST /users/{id}/cats/deassign |
11:14 |
|
|
fsvehla joined #rest |
11:16 |
|
trygvis |
the paths are never important |
11:50 |
|
sz332 |
trygvis: my question is whether this is a good design, or not? |
11:51 |
|
sz332 |
trygvis: i have seen stuff like /action/active /action/deactivate |
11:51 |
|
spaceone |
I wouldn't like to "POST assign" but to PUT .../cats" with <categories>...</categories> as payload |
11:52 |
|
trygvis |
sz332: URL design is not a part of REST, it really does not matter what you do |
11:52 |
|
trygvis |
do whatever is easiest to consume and implement |
11:53 |
|
sz332 |
spaceone: and how would you tell the server that the action is an assignment, or deassignment? (think about those left-right assign-deassign panels on client side) |
11:53 |
|
spaceone |
sz332: by providing the full representation of the new state |
11:53 |
|
spaceone |
the server can diff with the current state then |
11:53 |
|
sz332 |
spaceone: ah, okay, that makes sense |
11:53 |
|
spaceone |
and knows where to assign and where to deassign |
11:54 |
|
sz332 |
spaceone: actually, it is quite nice approach |
11:54 |
|
spaceone |
:) |
11:55 |
|
sz332 |
spaceone: so this means GET /users/{id}/cats returns the assigned cats, PUT /users/{id}/cats assigns the cats, and GET /users/{id}/cats/available returns the cats which are not associated? |
11:55 |
|
spaceone |
yes, that is the way HTTP was meant to be used |
11:57 |
|
sz332 |
okay, thank you very much |
11:57 |
|
spaceone |
and you could also do thing like POST /users/{id}/cats to add one. or DELETE /users/{id}/cats/foo to remove one |
11:59 |
|
|
wsieroci joined #rest |
13:12 |
|
|
tbsf joined #rest |
15:48 |
|
|
tbsf joined #rest |
16:02 |
|
|
timg___ joined #rest |
16:15 |
|
|
ChrisAnn left #rest |
16:41 |
|
|
Coldblackice joined #rest |
17:44 |
|
|
fsvehla joined #rest |
17:52 |
|
|
fsvehla joined #rest |
18:41 |
|
|
Devastator_ joined #rest |
18:48 |
|
|
mooncup joined #rest |
21:02 |
|
|
tbsf joined #rest |
21:53 |
|
|
quimrstorres joined #rest |
22:00 |
|
|
fuzzyhorns joined #rest |
22:06 |
|
|
timg___ joined #rest |
23:30 |
|
|
timg____ joined #rest |