0

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?

DSTRACK
  • 73
  • 1
  • 10

1 Answers1

2

Well, here are the steps on how to achieve this

  1. Create a sample Spring MVC app (there are many tutorials on the web)
  2. Use a file upload library i.e. Apache Commons File Upload
  3. You can configure the file upload property in spring's application context to state how much the size of the file should be
  4. Use Spring web's Multipart File in a request mapping to map your post request
  5. Read the recently uploaded Multipart File and convert it into HashMap depending on structure of the file
  6. Insert the Hashmap into Redis

Here are some useful SO question about the same topic

And some external links

Community
  • 1
  • 1
Raf
  • 7,505
  • 1
  • 42
  • 59