Published Thursday, April 23, 2009
This is the second post in a four-part series about extending a simple Webmachine resource. The first part discussed adding support for the HTTP method PUT.
Something about modification of server state screams, "Password protection!" at me. Let's guard the PUT method with Basic auth:
- Only PUT is protected. If GET and HEAD should be protected as well, just replace the body of is_authorized/2 with the body of basic_auth/2
I need to update my curl command if I don't want to be told I'm unauthorized:
Come back tomorrow for part three, where I add a modicum of atomicity.
Update: part three is up.
Categories: Development Erlang Webmachine
Post Copyright © 2009 Bryan Fink