Trying to use Spring Boot REST to Read JSON String from POST

前端 未结 5 1547
谎友^
谎友^ 2020-12-04 09:46

Am using the latest version of Spring Boot to read in a sample JSON via Restful Web Service...

Here\'s my pom.xml:



        
5条回答
  •  温柔的废话
    2020-12-04 10:01

    To further work with array of maps, the followings could help:

    @RequestMapping(value = "/process", method = RequestMethod.POST, headers = "Accept=application/json")
    public void setLead(@RequestBody Collection> payload) throws Exception {
    
      List> maps = new ArrayList>();
      maps.addAll(payload);
    
    }
    

提交回复
热议问题