It\'s my Feign interface
@FeignClient(
name=\"mpi\",
url=\"${mpi.url}\",
configuration = FeignSimpleEncoderConfig.class
)
public inte
It seems to me that Map is not valid for form body. MultiValueMap works just fine.
Feign client:
@FeignClient(name = "name", url="url", configuration = FromUrlEncodedClientConfiguration.class)
public interface PayPalFeignClient {
@RequestMapping(value = "/", method = POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
@Headers("Content-Type: application/x-www-form-urlencoded")
String foo(MultiValueMap formParams);
}
Config:
@Configuration
public class FromUrlEncodedClientConfiguration {
@Autowired
private ObjectFactory messageConverters;
@Bean
@Primary
@Scope(SCOPE_PROTOTYPE)
Encoder feignFormEncoder() {
return new FormEncoder(new SpringEncoder(this.messageConverters));
}
}
Gradle dependencies:
compile group: 'io.github.openfeign.form', name: 'feign-form', version: '2.0.2'
compile group: 'io.github.openfeign.form', name: 'feign-form-spring', version: '2.0.5'
After that all you have to do is call it with a MultivalueMap parameter.