handling messages as a parameter in the URL when there is a redirection #29

Open
ErikaHarker wants to merge 7 commits from ErikaHarker/core:main into develop
Showing only changes of commit 3d4b3651f2 - Show all commits

View file

@ -89,6 +89,22 @@ func (c *Context) GetRequesBodyMap() map[string]interface{} {
return dat
}
// get raw data for file binary
func (c *Context) GetRawBody() ([]byte, error) {
if c.Request.httpRequest.Body == nil {
return nil, errors.New("empty body")
}
defer c.Request.httpRequest.Body.Close()
data, err := io.ReadAll(c.Request.httpRequest.Body)
if err != nil {
return nil, err
}
return data, nil
}
// get json body and bind to dest interface
func (c *Context) GetRequesBodyStruct(dest interface{}) error {
body := c.Request.httpRequest.Body