Closed applejag closed 3 years ago
We more or less only want to use ShouldBindJSON, because BindJSON also sets status code to 400 (Bad Request) and Content-Type: text/plain; charset=utf-8, and gin will spam warnings in the logs if you set those multiple times.
Content-Type: text/plain; charset=utf-8
Docs: https://github.com/gin-gonic/gin#model-binding-and-validation
We more or less only want to use ShouldBindJSON, because BindJSON also sets status code to 400 (Bad Request) and
Content-Type: text/plain; charset=utf-8
, and gin will spam warnings in the logs if you set those multiple times.Docs: https://github.com/gin-gonic/gin#model-binding-and-validation