I have to build a Spring MVC project with java to handle an http post request of a json file and parse it to a hashmap. I just need to know how to handle an http post request sent through CURL and parse/read the data coming from that json file?
Asked
Active
Viewed 585 times
1 Answers
2
Well, here are the steps on how to achieve this
- Create a sample Spring MVC app (there are many tutorials on the web)
- Use a file upload library i.e. Apache Commons File Upload
- You can configure the file upload property in spring's application context to state how much the size of the file should be
- Use Spring web's Multipart File in a request mapping to map your post request
- Read the recently uploaded Multipart File and convert it into HashMap depending on structure of the file
- Insert the Hashmap into Redis
Here are some useful SO question about the same topic
And some external links
-
Brief explanation. Nice – Tharsan Sivakumar Oct 04 '16 at 05:14