mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
Update json.go
This commit is contained in:
parent
53fbf4dbfb
commit
dd85b9721e
@ -34,6 +34,10 @@ func (jsonBinding) Bind(req *http.Request, obj any) error {
|
||||
if req == nil || req.Body == nil {
|
||||
return errors.New("invalid request")
|
||||
}
|
||||
body, err := req.GetBody()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return decodeJSON(req.Body, obj)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user