diff options
author | Alex Lobunets <alexander.lobunets@gmail.com> | 2014-02-07 10:02:41 +0100 |
---|---|---|
committer | Alex Lobunets <alexander.lobunets@gmail.com> | 2014-02-07 10:02:41 +0100 |
commit | d47df4de58172593c56513d37d2b75d4af578e58 (patch) | |
tree | 44c87db740ef852b085d4b526badd836d818c984 /README.md | |
parent | remove tests.test (diff) | |
download | sleepy-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.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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() { |