79480356

Date: 2025-03-03 07:09:00
Score: 1
Natty:
Report link

how about using BodyParser?

if err := c.BodyParser(&fiber.Map{}); err != nil {
    return err
}

// get the form data as map
form := c.Request().PostArgs()

// iterate and append
var stateValues []string
form.VisitAll(func(key, value []byte) {
    if string(key) == "state" {
        stateValues = append(stateValues, string(value))
    }
})

oterwise we can use the multipart form parser

form, err := c.MultipartForm()
if err != nil {
    return err
}

stateValues := form.Value["state"]
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): how
  • Low reputation (0.5):
Posted by: MJepbarov