Skip to content

🐛 [Bug]: Missing Content-Type breaks Bind.All functionality #3658

@prasad83

Description

@prasad83

Bug Description

Setup Get request endpoint.

app.Get("/api/hello", func (c fiber.Ctx) error {
    var payload struct {
        Message string
     }
     if err := c.Bind().All(&payload); err != nil {
        return err;
     }
     return c.JSON(payload.Message)
}

How to Reproduce

Use curl to make the request.

curl -v http://server.location/api/hello?message=world

Response: Unprocessable Entity Error

Expected Behavior

Response: OK with message parameter returned back.

Fiber Version

3 beta 5

Code Snippet (optional)

package main

import "github.com/gofiber/fiber/v3"
import "log"

func main() {
  app := fiber.New()

  // Steps to reproduce

  log.Fatal(app.Listen(":3000"))
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions