mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
add Context.ReadParams method
This commit is contained in:
16
_examples/request-body/read-params/main_test.go
Normal file
16
_examples/request-body/read-params/main_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/kataras/iris/v12/httptest"
|
||||
)
|
||||
|
||||
func TestReadParams(t *testing.T) {
|
||||
app := newApp()
|
||||
|
||||
e := httptest.New(t, app)
|
||||
|
||||
expectedBody := `myParams: main.myParams{Name:"kataras", Age:27, Tail:[]string{"iris", "web", "framework"}}`
|
||||
e.GET("/kataras/27/iris/web/framework").Expect().Status(httptest.StatusOK).Body().Equal(expectedBody)
|
||||
}
|
||||
Reference in New Issue
Block a user