From d47df4de58172593c56513d37d2b75d4af578e58 Mon Sep 17 00:00:00 2001 From: Alex Lobunets Date: Fri, 7 Feb 2014 10:02:41 +0100 Subject: 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 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') 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() { -- cgit