mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 19:07:06 +00:00
reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker
Former-commit-id: ed635ee95de7160cde11eaabc0c1dcb0e460a620
This commit is contained in:
18
_examples/request-body/read-xml/main_test.go
Normal file
18
_examples/request-body/read-xml/main_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/kataras/iris/v12/httptest"
|
||||
)
|
||||
|
||||
func TestReadXML(t *testing.T) {
|
||||
app := newApp()
|
||||
e := httptest.New(t, app)
|
||||
|
||||
expectedResponse := `Received: main.person{XMLName:xml.Name{Space:"", Local:"person"}, Name:"Winston Churchill", Age:90, Description:"Description of this person, the body of this inner element."}`
|
||||
send := `<person name="Winston Churchill" age="90"><description>Description of this person, the body of this inner element.</description></person>`
|
||||
|
||||
e.POST("/").WithText(send).Expect().
|
||||
Status(httptest.StatusOK).Body().Equal(expectedResponse)
|
||||
}
|
||||
Reference in New Issue
Block a user