Sending Multipart File as POST parameters with RestTemplate requests
A way to solve this without needing to use a FileSystemResource that requires a file on disk, is to use a ByteArrayResource, that way you can send a byte array in your post (this code works with Spring 3.2.3): MultiValueMap<String, Object> map = new LinkedMultiValueMap<String, Object>(); final String filename=”somefile.txt”; map.add(“name”, filename); map.add(“filename”, filename); ByteArrayResource contentsAsResource … Read more