gofr-dev / gofr

An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
https://gofr.dev
Apache License 2.0
3.6k stars 236 forks source link

add support for binary/octet stream in Bind method #1215

Open Umang01-hash opened 4 days ago

Umang01-hash commented 4 days ago

Pull Request Template

Description:

func HelloHandler(c *gofr.Context) (interface{}, error) {
    var data []byte
    if err := c.Bind(&data); err != nil {
        return nil, fmt.Errorf("failed to bind binary data: %w", err)
    }

    // Process the binary data
    fmt.Printf("Received binary data: %v\n", data)
    return string(data), nil
}

Checklist:

Thank you for your contribution!