Time Nick Message 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: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 10:19 singh_abhinav which tool I shall use for REST API testing 10:30 trygvis singh_abhinav: that is a too broad question 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 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 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 18:15 atoll Hi 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 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: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 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:19 atoll but wouldn't it make more sense to use websocket ? Isn't it really bad to spam ? 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.