mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 20:07:04 +00:00
Former-commit-id: bd6e0eb0508fb27aea2ff79ad3a82c0acdd51eb7
This commit is contained in:
@@ -8,9 +8,11 @@ func main() {
|
||||
app := iris.New()
|
||||
|
||||
app.Post("/", logAllBody, logJSON, logFormValues, func(ctx iris.Context) {
|
||||
body, err := ctx.GetBody()
|
||||
// body, err := ioutil.ReadAll(ctx.Request().Body) once or
|
||||
body, err := ctx.GetBody() // as many times as you need.
|
||||
if err != nil {
|
||||
ctx.Writef("error while reading the requested body: %v", err)
|
||||
ctx.StatusCode(iris.StatusInternalServerError)
|
||||
ctx.WriteString(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user