Great job on this library! It's really great to have this degree of control over a resource and it's making me think much deeper about REST than I have been previously and that is definitely a good thing.
Having worked through the tutorial on the Liberator homepage and I found a couple of areas where I couldn't get the code to work and a few areas were a bit more information would be helpful to newbies. If we can figure these out between us, I would be very happy to help update the tutorial if someone can tell me how.
* On the getting started page, the recommended version of liberator is [liberator "0.9.0"] but the latest is 0.10.0. I'm guessing it's just an oversight but is this there an incompatibility between the 2 versions I need to know about?
* I understand the principle of the examples on the decision graph page but I can't figure out how to get data into (-> ctx :request :params). It's probably just me being a noob but the closest I can get is as follows (note that I have modified the example to pprint the request)...
* About to connect() to localhost port 3000 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 3000 (#0)
> GET /secret HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8y zlib/1.2.5
> Host: localhost:3000
> Accept: text/html
> Content-Length: 10
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 404 Not Found
< Date: Sun, 17 Nov 2013 10:43:32 GMT
< Vary: Accept
< Content-Type: text/html;charset=UTF-8
< Content-Length: 680
< Server: Jetty(7.6.1.v20120215)
<
Sorry, try again.
<pre>{:request
{:ssl-client-cert nil,
:remote-addr "0:0:0:0:0:0:0:1",
:scheme :http,
:request-method :get,
:query-string nil,
:route-params {},
:content-type "application/x-www-form-urlencoded",
:uri "/secret",
:server-name "localhost",
:params {},
:headers
{"user-agent"
"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8y zlib/1.2.5",
"content-type" "application/x-www-form-urlencoded",
"content-length" "10",
"accept" "text/html",
"host" "localhost:3000"},
:content-length 10,
:server-port 3000,
:character-encoding nil,
:body #<HttpInput org.eclipse.jetty.server.HttpInput@20edcce1>}}
</pre>
* Connection #0 to host localhost left intact
* Closing connection #0
* Separately, when I try to PUT to /secret I get a 405 error - which is correct but I found a little confusing given that the example at the end of the previous page was using curl to do a put.
(def handler
(-> app
(wrap-trace :header :ui)))
(defonce server (run-jetty #'handler {:port 3000 :join? false}))
(defn start [] (.start server))
(defn stop [] (.stop server))
(defn restart []
(stop)
(start))
(restart)
* The POST example does not include the definition of the 'posts' ref so I had to figure out it was a vector
* There are a few inconsistencies in the navigation
- The page after Decision Graph should be Debugging if it is to match the order in the side bar - although it mentions ETags which have not been introduced at that stage so maybe it should come later
- Some of the pages don't have a "next page" link at the end