Closed liubao68 closed 1 year ago
Hello @liubao68, thanks for reporting this. Makes sense.
@OlgaMaciaszek I am integrating new version and make a test, and find that this fix is not complete because FeignOutputMessage
has private access. I can not create a class to inherit SpringEncoder
public class ExtendedSpringEncoder extends SpringEncoder {
// ...
@Override
protected boolean binaryContentType(FeignOutputMessage outputMessage) {
// ...
}
}
will have compile error.
Thanks, @liubao68. Will fix it.
Is your feature request related to a problem? Please describe. My application needs support a
x-application/hessian2
media type, and we created a HttpMessageConverter like this:When I using feign with ApacheHttpClient, feign will give a charset of UTF-8, and HttpClient will encode the final stream to UTF-8 string and data get losed.
SpringEncoder charset code snippet:
Describe the solution you'd like
add a easier way for extending SpringEncoder to support other binary type. e.g.
change to
Describe alternatives you've considered Current I copied the code from SpringEncoder and changed the binaryContentType method to
Additional context
When I use feign with java URLHttpConnection do not have this problem, because URLHttpConnection will not encode body based on the charset.