From e23c5c65d0139c54d0a88907b7d418152f07cd2f Mon Sep 17 00:00:00 2001 From: Doug Black Date: Sat, 29 Mar 2014 23:26:34 -0700 Subject: update README --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c5ceb7..eacf343 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,22 @@ package main import ( "net/url" + "net/http" "github.com/dougblack/sleepy" ) type Item struct { } -func (item Item) Get(values url.Values, headers map[string][]string) (int, interface{}, map[string][]string) { +func (item Item) Get(values url.Values, headers http.Header) (int, interface{}, http.Header) { items := []string{"item1", "item2"} data := map[string][]string{"items": items} - return 200, data, map[string][]string{"Content-type": {"application/json"}} + return 200, data, http.Header{"Content-type": {"application/json"}} } func main() { item := new(Item) - var api = sleepy.NewAPI() + api := sleepy.NewAPI() api.AddResource(item, "/items") api.Start(3000) } -- cgit