aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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