Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Nov 24, 2024

Conversation

Umang01-hash
Copy link
Contributor

@Umang01-hash Umang01-hash commented Nov 18, 2024

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:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

pkg/gofr/http/request_test.go Outdated Show resolved Hide resolved
pkg/gofr/http/request.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor remarks, but 👍

pkg/gofr/http/middleware/logger.go Show resolved Hide resolved
pkg/gofr/http/request.go Outdated Show resolved Hide resolved
@vikash vikash merged commit 18fc004 into development Nov 24, 2024
12 checks passed
@vikash vikash deleted the en/binary/octet_stream_support branch November 24, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants