I am using postman packaged app to send a post request.
I want to request the following controller.
How to send a post requestbody using postman object(with values) and a list using the raw format?
@RequestMapping(value = "register", method = RequestMethod.POST)
@ResponseBody
public ResponseMessage save(@RequestBody Freelancer freelancer, @RequestBody List<Integer> skills) {
I have tried like this :
{
"address": "colombo",
"username": "hesh",
"password": "123",
"registetedDate": "2015-4-3",
"firstname": "hesh",
"contactNo": "07762",
"accountNo": "16161",
"lastName": "jay"
}
{
"array[0]" :1436517454492,
"array[1]" :1436517476993
}
The Best Answer is
Make sure that you have made the content-type
as application/json
in header request and Post from body under the raw tab.
{
"address": "colombo",
"username": "hesh",
"password": "123",
"registetedDate": "2015-4-3",
"firstname": "hesh",
"contactNo": "07762",
"accountNo": "16161",
"lastName": "jay",
"arrayObjectName" : [{
"Id" : 1,
"Name": "ABC" },
{
"Id" : 2,
"Name" : "XYZ"
}],
"intArrayName" : [111,222,333],
"stringArrayName" : ["a","b","c"]
}
Full answer is published on Syntaxfix.com