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.54k stars 233 forks source link

Add support for binary/octet-stream in http/request.go Bind #1143

Open vhodges opened 4 days ago

vhodges commented 4 days ago

I have a need to access to the request.Body in it's raw []byte form for my application (clients will GET or POST an endpoint with a document included as the body).

I see three potential ways that you might allow this:

  1. provide a way to do Bind()ing using binary/octet-stream
  2. simply expose a Body() method on Request.
  3. Provide way to register a custom route to App with a standard library Handler so that I can process it myself.

My only other option right now is to use a multipart/form-data with a file field, however this will complicate the client side considerably (imo) and would consider porting away from gofr (which would be a shame since there's so much to like otherwise).

coolwednesday commented 4 days ago

Hi @vhodges,

Thank you for bringing this to our attention! You can expect it to be resolved soon. Stay tuned for updates!