You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FormHttpMessageConverter should support non-String form values [SPR-17645] #22174
When T is MultiValueMap<String, Object>, and the values of the map contains non-string values such as Integer, an invoke to RestTemplate (with Content-Type "application/x-www-form-urlencoded") will cause ClassCastException.
I've attached a demo project that can re-produce this bug.
MultiValueMap<String, Object> body = newLinkedMultiValueMap<String, Object>();
body.add("Parameter1", "Value1"); // This is finebody.add("Parameter2", 2147483647); // This value will trigger the bug after calling RestTemplate to send out this request.
I've merged your commit as part of an improvement where we're supporting MultiValueMap<String, Object> for form data as well now. I've also added a corresponding note to FormHttpMessageConverter's javadoc.
Activity
spring-projects-issues commentedon Jan 8, 2019
Juergen Hoeller commented
I've merged your commit as part of an improvement where we're supporting
MultiValueMap<String, Object>for form data as well now. I've also added a corresponding note toFormHttpMessageConverter's javadoc.