1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

add a test near to the _examples/routing/basic example

Former-commit-id: 24b4ffc004f76355f6269a95ede3488fff9dfe36
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-07-30 06:04:08 +03:00
parent 700dcc8005
commit 04834484ff
4 changed files with 103 additions and 32 deletions

View File

@@ -1,8 +1,6 @@
package main
import (
"io/ioutil"
"github.com/kataras/iris"
)
@@ -108,7 +106,7 @@ func newApp() *iris.Application {
// to protect ourselves from "over heating".
app.Post("/", iris.LimitRequestBodySize(maxBodySize), func(ctx iris.Context) {
// get request body
b, err := ioutil.ReadAll(ctx.Request().Body)
b, err := ctx.GetBody()
// if is larger then send a bad request status
if err != nil {
ctx.StatusCode(iris.StatusBadRequest)