greptilian logo

IRC log for #rest, 2014-09-29

https://trygvis.io/rest-wiki/

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:14 systmkor4 joined #rest
00:20 citanul joined #rest
00:21 citanul Hiya!  I'm new to REST APIs.  We have an iPhone client and calling the REST API is ending up with a lot of calls and network overhead.  Do REST APIs ever have a layer on top of them to include business logic?
00:28 pdurbin hmm. a layer on top. you want fewer network calls
00:28 tr3online joined #rest
00:31 citanul I want fewer client calls to be more specific
00:51 krainboltgreene citanul: Check out jsonapi.org
00:52 krainboltgreene It gives protocol hints for how to handle more or less information per request.
00:55 fumanchu bigger responses mean fewer network calls for the same data. if you have control over the design of the REST API, rethink the boundaries between resources
03:07 igitoor joined #rest
03:15 igitoor joined #rest
04:19 _ollie joined #rest
05:37 MasterPiece joined #rest
07:04 proteusguy joined #rest
07:04 rosstuck joined #rest
07:27 interop_madness joined #rest
07:47 systmkor joined #rest
08:07 azr joined #rest
08:14 fumanchu_ joined #rest
08:19 graste joined #rest
08:27 azr joined #rest
08:28 azr joined #rest
08:33 fumanchu joined #rest
08:43 azr joined #rest
08:46 azr joined #rest
09:01 azr joined #rest
09:35 ChrisAnn joined #rest
09:56 Left_Turn joined #rest
10:02 fumanchu_ joined #rest
10:19 singh_abhinav joined #rest
10:19 singh_abhinav which tool I shall use for REST API testing
10:23 azr joined #rest
10:30 trygvis singh_abhinav: that is a too broad question
10:44 Andre-B joined #rest
11:55 fumanchu joined #rest
11:57 fumanchu1 joined #rest
11:58 charlie_ joined #rest
12:11 azr joined #rest
12:20 shrink0r joined #rest
12:45 ramsey joined #rest
13:12 Andre-B joined #rest
13:17 _ollie joined #rest
13:27 rue joined #rest
14:13 saml joined #rest
14:19 pezra joined #rest
15:14 _ollie1 joined #rest
15:14 shrink0r joined #rest
15:29 bigbluehat joined #rest
15:40 Mxyzpltk joined #rest
16:11 systmkor1 joined #rest
16:14 Andre-B joined #rest
16:16 proteusguy joined #rest
16:37 bigbluehat hi all. I'm pondering sending the WWW-Authenticate header and a custom auth scheme in 20* ranged responses
16:37 bigbluehat browsers don't seem to care (quick test across the 4 majors)
16:38 bigbluehat but wasn't sure if that was specified as a "bad idea" already...or if this was some margin I could play in :)
16:38 bigbluehat 401 responses MUST send WWW-Authenticate...but that's all I've seen so far
16:39 trygvis AFAIK that is totally fine
16:40 trygvis new RFCs are expected to define new WWW-Authenticate types, oauth specifies one extra
16:41 bigbluehat trygvis: fab :)
16:41 bigbluehat gonna chew on this and come back with more ?'s probably
16:41 bigbluehat tnx!
16:43 dreamdust joined #rest
16:43 dreamdust What's the RESTful way of returning partial representations of the same resource?
16:44 dreamdust like… let's say I just want to get two fields of a user object and not the entire user object
16:44 trygvis none
16:44 trygvis you only deal with whole representations
16:45 trygvis you have PATCH to update parts of a representation
16:45 saml I do this   GET /content?fields=a,b     hahaha
16:45 dreamdust saml that's what I've seen
16:46 dreamdust trygvis: I'm talking about GET
16:46 trygvis that's ok, /content is a different resource from /content?fields=a,b
16:46 dreamdust are you saying that different media types should be used
16:46 saml yup
16:46 trygvis no, that won't work
16:46 saml no, those are different resources
16:46 dreamdust yeah thats what I thought
16:46 dreamdust thx
16:47 trygvis the problem with having multiple resources is that you're bound to loose caching
16:47 dreamdust What about this then ? http://tools.ietf.org/html/rfc7240
16:47 saml why do you want to get two fields? I've also seen hierarchical resources.   /users/1/first_name
16:51 dreamdust My coworkers were thinking of using a weird header field to return different representations of a resource… and I thought that sounded very weird.
16:51 Mxyzpltk joined #rest
16:51 dreamdust since I've mainly seen it done as saml suggested
16:52 trygvis if you're using special headers you're most likely not very RESTful
16:52 trygvis unless you have a media type that is HTTP-specific and tells you how to create these magic headers
16:52 dreamdust right
16:53 pezra if that "weird header field" is `Prefer` or `Accept` it is very restful
16:53 saml you need to configure your caching to cache those properly
16:54 saml normalize Accept before generating cache key
16:54 trygvis pezra: you're a good http client at least
16:55 pezra any non-broken cache will handle them correctly assuming the `Vary` header is set correctly
16:55 saml i mean, in the wild, Accept is wild
16:56 pezra by "cache", i meant "http cache"
16:57 fumanchu1 the difficult insight is that your typical object might span multiple resources/URLs, and there's nothing wrong with that. OO languages like to define object boundaries based on programmer ease of use. REST API's need to define boundaries based on atomic transactions and caching.
16:59 fumanchu1 if your API maps resources 1:1 with objects, you're almost certainly Doing It Wrong: you won't see benefits from the REST architectural style like scalability, evolvability, etc
17:00 fumanchu1 at the least, you need to start by defining the representation boundaries, and work backward to designing the objects, rather than the other direction
17:22 Mxyzpltk joined #rest
17:56 _ollie joined #rest
18:15 atoll joined #rest
18:15 atoll Hi
18:29 systmkor joined #rest
18:38 shrink0r joined #rest
18:39 saml hi atoll
18:40 bigbluehat dreamdust: here's another way http://amundsen.com/examples/fielding-props/docs
18:40 bigbluehat for the "partial resource" thing
18:40 bigbluehat which are quite similar to TimBL's Matrix space URLs: http://www.w3.org/DesignIssues/Axioms.html#matrix
18:44 atoll I send a question on stackoverflow that I wanted to ask here
18:44 atoll http://stackoverflow.com/questions/26106611/receive-update-from-server-with-mobile-framework
18:44 atoll ( I thought the channel was dead :d)
18:45 whartung This channel is like one of those dark smokey bars where everyone turns to see who walks in teh door, but noone makes a sound unless the stranger starts dancing.
18:45 bigbluehat haha...terribly accurate I'm afraid ;)
18:46 bigbluehat atoll: as with any channel, it's as active as the participants are at the moment ^_^
18:46 begriffs joined #rest
18:46 bigbluehat if it's too quite, make noise ;)
18:47 atoll Shall I put a resume of my stackoverflow question here ?
18:48 bigbluehat nah, we can click the link and answer there :)
18:54 whartung I posted atoll
18:57 atoll It's a very good explanation whartung
18:57 atoll thank you
18:57 whartung yw
18:57 whartung to lunch, bbl
18:57 atoll Do you have any recommendation ?
18:57 atoll (to use instead of rest)
18:58 atoll I guess socket (or websockets) are what I'm seaching, but I'm not sure how to include them into phonegap
19:01 Mxyzpltk joined #rest
19:02 bigbluehat atoll: you'll probably best best off asking the phonegap kids for that one :)
19:09 atoll a phonegap kid recomment me to spam post
19:09 atoll recommend*
19:38 bigbluehat atoll: spam post? :)
19:38 bigbluehat where?
19:39 atoll you post to the server the last version number of the content you have
19:39 atoll if there is new content, the server responds with the new content
19:39 atoll that feels very dirty
19:39 atoll but no one else answers
19:46 systmkor1 joined #rest
20:01 systmkor2 joined #rest
20:09 Andre-B joined #rest
20:12 atoll joined #rest
20:13 whartung you can simply use an etag or if-modified header atoll, and yea, spam it as often as you feel comfortable doing it.
20:15 dreamdust joined #rest
20:19 atoll but wouldn't it make more sense to use websocket ? Isn't it really bad to spam ?
20:30 atoll2 joined #rest
20:34 ironChicken joined #rest
20:34 whartung a websocket is fine atoll2, basically since the pattern is out of scope (unless you want to poll), you can use do whatever you want.
20:48 systmkor3 joined #rest
21:01 rue joined #rest
21:06 cigarshark joined #rest
21:07 systmkor4 joined #rest
21:09 azr joined #rest
21:19 dreamdust joined #rest
21:37 Mxyzpltk joined #rest
21:49 azr joined #rest
21:51 azr_ joined #rest
21:59 Mxyzpltk joined #rest
22:07 systmkor joined #rest
22:09 pezra joined #rest
22:18 azr joined #rest
22:32 azr joined #rest
22:53 systmkor2 joined #rest
23:24 azr joined #rest
23:33 systmkor3 joined #rest
23:59 Mxyzpltk joined #rest

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

https://trygvis.io/rest-wiki/