I am using spring webmvc for my project, and there i am using @ModelAttribute annotation in controller action to bind the form data to model. ModelAttribute is binding data fine if i am sending data in x-www-form-urlencoded form.But if i am sending data in simple form-data then it is not binding.
I am sending request using POSTMAN Rest Client, below is the format of my request -
POST /register-school HTTP/1.1
Host: localhost:8080
Accept: application/json
Cache-Control: no-cache
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="email"
testing@test.com
----WebKitFormBoundaryE19zNvXGzXaLvS5C
For this above request my ModelAttribute is not binding data to object.
But Its working if i am sending request in x-www-form-urlencoded
POST /register-school HTTP/1.1
Host: localhost:8080
Accept: application/json
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
email=testing%40test.com
Is there is any way to make ModelAttribute to work with form-data also?