mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 15:40:58 +00:00
1 line
3.9 KiB
JSON
1 line
3.9 KiB
JSON
[{"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023752.4965091, "message": "seems to work quite well", "group_id": 81, "id": 847101}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304025027.1997211, "message": "I'm still not sure I get how it's more insecure to send JSON encoded data in a header than in the response body, other than perhaps the client code evaluating it sucks.", "group_id": 81, "id": 847352}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023835.1126821, "message": "for example: say I have a view that handles a form via AJAX, and on form success, I just want to return some new HTML for insertion in the page.", "group_id": 81, "id": 847122}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023876.9699161, "message": "I could use a JSON response to say what the ID is, and then have one of the JSON attributes contain the new HTML, but that feels ugly", "group_id": 81, "id": 847129}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023905.0766079, "message": "and any metadata be in custom response headers", "group_id": 81, "id": 847139}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304024794.057632, "message": "@j4mie cool. thanks for the link. I figured there was something like this out there.", "group_id": 81, "id": 847300}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023848.1001141, "message": "But in my JS I'd like to know the ID of the newly created object", "group_id": 81, "id": 847124}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304024081.135577, "message": "advice welcome :)", "group_id": 81, "id": 847180}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023744.163609, "message": "is this a bad idea?", "group_id": 81, "id": 847099}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304024025.6597559, "message": "$.parseJSON(xhr.getResponseHeader('X-Metadata'))", "group_id": 81, "id": 847162}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023935.6048379, "message": "accessable in jQuery via xhr.getResponseHeader('X-Your-Header-Name')", "group_id": 81, "id": 847142}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023999.8508379, "message": "Taking this further, I really want a generic \"X-Metadata\" to contain JSON that I can then handle in JS", "group_id": 81, "id": 847155}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304024067.370239, "message": "or if there is some small limit on the allowed length of an HTTP header.", "group_id": 81, "id": 847175}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023886.5026519, "message": "I'd rather the response body be the HTML", "group_id": 81, "id": 847132}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304023960.0226901, "message": "where \"xhr\" is the XMLHttpRequest object", "group_id": 81, "id": 847146}, {"user_id": 1963, "stars": [], "topic_id": 21864, "date_created": 1304024044.5246971, "message": "works like a champ, but I don't know if there are other implications I haven't thought out", "group_id": 81, "id": 847168}, {"user_id": 5980, "stars": [], "topic_id": 21864, "date_created": 1304024524.9727731, "message": "I'm sure it's possible.. but it feels.. wrong :) looks like Rails and Prototype tried a similar thing a few years back: http://devcentral.f5.com/weblogs/macvittie/archive/2009/04/07/ruby-developers-ignore-security-risks-claim-x-json-header-lsquonothing-seriousrsquo.aspx", "group_id": 81, "id": 847256}, {"user_id": 927, "stars": [], "topic_id": 21864, "date_created": 1304035244.4103439, "message": "You could also use a data attribute in your HTML. With recent jQuery it'd be simple: $.load(\u2026) gets <foo data-record-id=123> and $(\"\u2026\").data(\"record-id\")", "group_id": 81, "id": 848713}] |