mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
replace ioutil with io package and other minor improvements
This commit is contained in:
@@ -8,7 +8,7 @@ func main() {
|
||||
app := iris.New()
|
||||
|
||||
app.Post("/", logAllBody, logJSON, logFormValues, func(ctx iris.Context) {
|
||||
// body, err := ioutil.ReadAll(ctx.Request().Body) once or
|
||||
// body, err := io.ReadAll(ctx.Request().Body) once or
|
||||
body, err := ctx.GetBody() // as many times as you need.
|
||||
if err != nil {
|
||||
ctx.StopWithError(iris.StatusInternalServerError, err)
|
||||
|
||||
Reference in New Issue
Block a user