how to use spring-cloud-feign to download file?
See original GitHub issuei try to define a feign-client like this:
@FeignClient(value = "epolicy", path = "/epolicy/download", url = "http://10.1.118.45:8001")
public interface EPolicyApi {
@RequestMapping(method = RequestMethod.POST)
byte[] download(@RequestParam("policyNo") String policyNo, @RequestParam("idNo") String idNo);
}
my http response’s MediaType is application/msdownload。
should i customize a HttpMessageConvter or do some other job?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Feign for downloading file - spring boot - Stack Overflow
I am trying to find a simple way to use Feign to download a csv file (retaining the filename).
Read more >File upload and download using openfeign - Spring Cloud
Table of Contents. Using Feign independently. Upload files; Download the file. Using Spring Cloud Feign. Uploading files; Download the file.
Read more >File Upload With Open Feign - Baeldung
In this tutorial, we'll demonstrate how to upload a file using Open Feign. Feign is a powerful tool for microservice developers to ...
Read more >OpenFeign] 5 Feign Spring Cloud upload、download File ...
今天博主要总结的是如何运用Spring Cloud Feign 来实现文件上传下载功能。 ... log.info("Use feign Call service file download");
Read more >[Solved]-Feign for downloading file-Springboot - appsloveworld
Related Query · Feign for downloading file · Spring Boot endpoint for downloading File automatically · How to make file downloadable from server...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I do it. Here is my code,including uploading and downloading. I use feign-form to upload file. feign-form
Feign-form maven dependencies
@beldon Your rewritten behavior is consistent with my thoughts.But my final practice is to use byte[] as the return value which supported by
ByteArrayHttpMessageConverter.Then use the service turns byte[] to file or other type. In my opinion,your inMemoryMultipartFile may be in line with OO design.but MultipartSupportConfig almost will not be reused.:)