httpbuilder
httpbuilder copied to clipboard
Use charset from request content-type for body encoding if present
When using HTTPBuilder with grails-rest-plugin on a platform with default encoding set to US-ASCII we realized that by default HTTPBuilder will use the platform's default encoding to encode request bodies if not explicitly set to a different value by calling EncoderRegistry.setCharset(...)
.
Especially setting the charset on the request content-type (e. g. application/json; charset=UTF-8
) did not change this behaviour.
It would be very convenient and also consistent in my opinion to use the charset from the request content-type for body encoding if present.