Skip to content

Commit 5444f99

Browse files
committed
Added request Query and Body in context
1 parent 9b91836 commit 5444f99

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (api API) ServeHTTP(res http.ResponseWriter, req *http.Request) {
7979
ctx := Context{
8080
Request: req,
8181
Response: res,
82+
Query: req.URL.Query(),
8283
}
8384

8485
// STEP 1: initialize context

context.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package rest
77

88
import (
99
"net/http"
10+
"net/url"
1011

1112
"github.com/go-rs/rest-api-framework/render"
1213
)
@@ -17,6 +18,8 @@ import (
1718
type Context struct {
1819
Request *http.Request
1920
Response http.ResponseWriter
21+
Query url.Values
22+
Body map[string]interface{}
2023
Params map[string]string
2124
data map[string]interface{}
2225
err error

0 commit comments

Comments
 (0)