I have to write a REST API whcih consumes `multipart/form-data`. When I write the method like below , it works fine

```
@RequestMapping(value="/addSftp", method=RequestMethod.POST)
public HashMap<String, Object> welcome( HttpServletRequest request,@RequestParam(value="selectedFile", required=false) MultipartFile selectedFile,
        @RequestParam(value="sftp_name") String sftp_name,
        @RequestParam(value="ip_address")String ip_address,
        @RequestParam(value="port_number")String port_number,
        @RequestParam(value="userName")String userName,
        @RequestParam(value="password")String password,
        @RequestParam(value="customRadioInline1")String customRadioInline1) {
    HashMap map = new HashMap<String, Object>();
    System.out.println(sftp_name);
    System.out.println(ip_address);
    System.out.println(port_number);
    System.out.println(userName);
    System.out.println(password);
    System.out.println(customRadioInline1);
    System.out.println(selectedFile);
    map.put("stat", "success");
     return map;
              }

```

I want to map the request to a bean. Below is my bean

```
public class SftpBean {

    private String sftp_name;
    private String ip_address; 
    private String port_number;
    private String userName;
    private String password;
    private String customRadioInline1;
    private MultipartFile selectedFile;

//getters and setters here

}

```

But when I write the method like below , I am getting exception

```
public HashMap<String, Object> welcome( @RequestBody SftpBean sftpBean) {
    HashMap map = new HashMap<String, Object>();
    System.out.println(sftpBean.getIpAddress());
    //similar statements for priniting other parameters
    map.put("stat", "success");
     return map;
}

```

Here is my exception

```
Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: 
    Content type 'multipart/form-data;boundary=---------------------------246741595337214313524058968681;charset=UTF-8' not supported]

```

Here is my request payload

```
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="sftp_name"

ABC
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="ip_address"

123
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="port_number"

456
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="userName"

demo
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="password"

demo123
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="customRadioInline1"

pwd
-----------------------------317042354532732980343175029806
Content-Disposition: form-data; name="selectedFile"; filename="details.txt"
Content-Type: text/plain

```

Is there a way to directly map the request to my `SftpBean`?