Feign config
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
Client
@PostMapping("/send")
@Headers("Content-Type: multipart/form-data")
void send (@ModelArttibute SendRequest request);
Request
public class SendRequest {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime time;
// Setter And Getter....
}
If I send the request out with Feign, I can see my request will have extra double quote for the time value.
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="file1"; filename="a.txt"
Content-Type: text/plain
"2022-12-14 11:47:20"
The request should be like as below
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="file1"; filename="a.txt"
Content-Type: text/plain
2022-12-14 11:47:20
How can I solve it? And what is the reason?
Comment From: OlgaMaciaszek
Hello @asdeq20062, please provide a minimal, complete, verifiable example that reproduces the issue as a link to a repo with a small executable app rather than separate code snippets - we'll take a look at it then.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.