Access the underlying request body #130
-
I'm trying at implement TUS (Resumable Upload) https://tus.io/protocols/resumable-upload.html The Patch method requires access to the Request Body to get the raw bytes. Is there anyway to get access to the Request Body in the input? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi, you can implement // Loader loads data from http.Request.
//
// Implement this interface on a pointer to your input structure to disable automatic request mapping.
Loader interface {
LoadFromHTTPRequest(r *http.Request) error
} |
Beta Was this translation helpful? Give feedback.
-
In a recently updated version, you can now access the body much easier, just by implementing |
Beta Was this translation helpful? Give feedback.
Hi, you can implement
request.Loader
on your input structure to take over request decoding (and validation).