Skip to content

Commit 31fc8df

Browse files
committed
add server request body
1 parent baf7de7 commit 31fc8df

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

server/rpc_request.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ func (r *rpcRequest) Header() map[string]string {
4747
return r.header
4848
}
4949

50+
func (r *rpcRequest) Body() interface{} {
51+
// TODO: convert to interface value
52+
return r.body
53+
}
54+
5055
func (r *rpcRequest) Read() ([]byte, error) {
5156
// got a body
5257
if r.body != nil {

server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ type Request interface {
5151
ContentType() string
5252
// Header of the request
5353
Header() map[string]string
54+
// Body is the initial decoded value
55+
Body() interface{}
5456
// Read the undecoded request body
5557
Read() ([]byte, error)
5658
// The encoded message stream

0 commit comments

Comments
 (0)