Using spring-mvc
annotations:
@FeignClient
that can POST
form-url-encoded
?Use FormEncoder for Feign:
And your Feign configuration can look like this:
class CoreFeignConfiguration {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters
@Bean
@Primary
@Scope(SCOPE_PROTOTYPE)
Encoder feignFormEncoder() {
new FormEncoder(new SpringEncoder(this.messageConverters))
}
}
Then, the client can be mapped like this:
@FeignClient(name = 'client', url = 'localhost:9080', path ='/rest',
configuration = CoreFeignConfiguration)
interface CoreClient {
@RequestMapping(value = '/business', method = POST,
consumes = MediaType.APPLICATION_FORM_URLENCODED)
@Headers('Content-Type: application/x-www-form-urlencoded')
void activate(Map<String, ?> formParams)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With