This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-05
Channels
- # aws (6)
- # beginners (10)
- # boot (33)
- # cider (23)
- # cljs-dev (50)
- # cljsjs (2)
- # cljsrn (10)
- # clojars (1)
- # clojure (215)
- # clojure-czech (1)
- # clojure-dev (5)
- # clojure-italy (23)
- # clojure-russia (18)
- # clojure-spec (11)
- # clojure-uk (53)
- # clojurescript (157)
- # core-async (29)
- # cursive (12)
- # data-science (15)
- # datascript (16)
- # datomic (68)
- # graphql (2)
- # jobs (5)
- # jobs-discuss (1)
- # juxt (17)
- # lein-figwheel (2)
- # luminus (3)
- # off-topic (155)
- # om (3)
- # pedestal (1)
- # portkey (1)
- # re-frame (7)
- # reagent (4)
- # ring (3)
- # ring-swagger (2)
- # rum (11)
- # unrepl (11)
- # vim (1)
- # yada (2)
Hi Malcolm. I’m enjoying yada and the philosophy - thanks to you and the juxt team for a principled tool that bundles a nice choice of libraries!
On the matter of the philosophical side of things: I found it a little odd that the response to a POST is 303
. In my journeys with using strict HTTP semantics, I’ve tended to use a 201
if the request caused a resource to be created. Along with the 201
would come a Location
header with the canonical URL of the newly minted resource. A response entity may also be in the response, and if so, probably the same thing a GET on the aforementioned resource would return (hopefully including some HAL-like links). The requesting party would then be happy with the 2xx status and follow the Location
header (or parse the response entity for other links to follow). When the requesting party is a browser, though, the browsers don’t follow Location
headers on 2xx status - and this is a pity (for it has lead to the POST-redirect-GET pattern). However, browsers do respect Refresh
headers. So there is no harm in including a Refresh: 0; <url>
along with a Location: <url>
in the response. This will then work for both pure HTML web applications and XHR-based ones, as well as machine requesters. You can test for yourself at http://www.mocky.io/v2/5934d70410000076073ee7fb which returns a 201
status, but where your browser will still end up at the Google. Thoughts?