aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDoug Black <dougblack@gatech.edu>2014-01-23 22:23:01 -0800
committerDoug Black <dougblack@gatech.edu>2014-01-23 22:23:01 -0800
commitef180141424c9991af7bc614d2b6809f731fe88f (patch)
tree030f5261edb007f6a9d4744d89a428ab48039bc5 /README.md
parentadd readme (diff)
downloadsleepy-ef180141424c9991af7bc614d2b6809f731fe88f.tar.gz
sleepy-ef180141424c9991af7bc614d2b6809f731fe88f.tar.bz2
sleepy-ef180141424c9991af7bc614d2b6809f731fe88f.zip
add response
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 13 insertions, 2 deletions
diff --git a/README.md b/README.md
index 62aa8ac..2d4b141 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,10 @@ import (
type Item struct { }
func (item *Item) Get(foo string, bar int) (interface{}, int, http.Headers) {
- return map[string]int { foo : bar}, 200, nil
+ data := map[string]int {
+ foo : bar
+ }
+ return data, 200, nil
}
func main() {
@@ -24,10 +27,18 @@ func main() {
var api = new(sleepy.Api)
api.AddResource(item, "/item")
- request, _ := http.NewRequest("GET", "/item", nil)
+ request, _ := http.NewRequest("GET", "/item", "foo=thing&bar=5")
fmt.Println(api.HandleRequest(request))
}
```
+With a response of
+
+``javascript
+{
+ "thing": 5
+}
+```
+
Stay tuned.
bgstack15