1. Justin Sheehy
  2. webmachine

Commits

Justin Sheehy  committed 7dc36ce

Automated commit message

  • Participants
  • Parent commits d0cbd9e
  • Branches default

Comments (0)

Files changed (1)

File ExampleResources.wiki

View file
  • Ignore whitespace
 
 For a very simple resource demonstrating content negotiation, basic auth, and some caching headers, see [[FixThisLink|webmachine_demo_resource]].
 
-Some example code from webmachine_demo_resource follows.
+Some example code based on webmachine_demo_resource follows.
 
 The simplest working resource could export only one function in addition to init/1:
 
 {{{
 #!erlang
 to_text(ReqData, Context) ->
-   webmachine_reqdata:disp_path(ReqData),
-   Body = io_lib:format("Hello ~p text~n", [Path]),
-   {Body, ReqData, Context}.
+    Path = wrq:disp_path(ReqData),
+    Body = io_lib:format("Hello ~s from webmachine.~n", [Path]),
+    {Body, ReqData, Context}.
 }}}
 
 Now that this resource provides multiple media types, it automatically performs conneg: