aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Lobunets <alexander.lobunets@gmail.com>2014-02-07 10:02:41 +0100
committerAlex Lobunets <alexander.lobunets@gmail.com>2014-02-07 10:02:41 +0100
commitd47df4de58172593c56513d37d2b75d4af578e58 (patch)
tree44c87db740ef852b085d4b526badd836d818c984 /README.md
parentremove tests.test (diff)
downloadsleepy-d47df4de58172593c56513d37d2b75d4af578e58.tar.gz
sleepy-d47df4de58172593c56513d37d2b75d4af578e58.tar.bz2
sleepy-d47df4de58172593c56513d37d2b75d4af578e58.zip
Added request headers as Get/Put/Post/Delete argument. Added response headers map as 3rd argument of the return from Get/Put/Post/Delete handlers. Thus, resource can access request headers and set custom response headers if required
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index 5794d22..a3cd587 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,10 @@ import (
type Item struct { }
-func (item Item) Get(values url.Values) (int, interface{}) {
+func (item Item) Get(values url.Values, headers map[string][]string) (int, interface{}, map[string][]string) {
items := []string{"item1", "item2"}
data := map[string][]string{"items": items}
- return 200, data
+ return 200, data, map[string][]string{"Content-type": "application/json"}
}
func main() {
bgstack15