You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ctx.BodyParser undefined (type fiber.Ctx has no field or method BodyParser)compilerMissingFieldOrMethod
Code Snippet (optional)
package main
import"github.com/gofiber/fiber/v3"import"log"funcmain() {
app:=fiber.New()
// An example to describe the questionlog.Fatal(app.Listen(":3000"))
}
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
It looks like it should be done via Ctx.Bind().Body
Source documentation:
Bind: You can bind body, cookie, headers etc. into the map, map slice, struct easily by using Binding method. It gives custom binding support, detailed binding options and more. Replacement of: BodyParser, ParamsParser, GetReqHeaders, GetRespHeaders, AllParams, QueryParser, ReqHeaderParser
Body: Body binds the request body into the struct, map[string]string and map[string][]string. It supports decoding the following content types based on the Content-Type header: application/json, application/xml, application/x-www-form-urlencoded, multipart/form-data If none of the content types above are matched, it'll take a look custom binders by checking the MIMETypes() method of custom binder. If there're no custom binder for m艧me type of body, it will return a ErrUnprocessableEntity error.
This change is currently not reflected in the official documentation
Question Description
Ctx.BodyParser undefined (type fiber.Ctx has no field or method BodyParser)compilerMissingFieldOrMethod
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: