aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDoug Black <dblack@twilio.com>2014-03-29 23:26:34 -0700
committerDoug Black <dblack@twilio.com>2014-03-29 23:26:34 -0700
commite23c5c65d0139c54d0a88907b7d418152f07cd2f (patch)
tree949cf91390ed92174119951239fed71dddd5273e /README.md
parentupdate AUTHORS.md (diff)
downloadsleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.tar.gz
sleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.tar.bz2
sleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.zip
update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files 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)
}
bgstack15