I'm having this exact same problem, though I'm POSTing through a very basic form within an HTML file.
Code:
@Controller
@RequestMapping("/events/**")
public class TrackingController {
@RequestMapping(value = "/events", method=RequestMethod.POST)
public void logEvent(@RequestBody MultiValueMap<String,Object> params) {
for (String key : params.keySet()) {
System.out.println("key: " + key);
System.out.println("value: " + params.get(key));
}
Here is the form:
Code:
<html>
<head>
<title>Log Event</title>
</head>
<body>
<h1>Log Event</h1>
<form action="http://localhost:8080/tracking/events" method="post">
<table>
<tr>
<td>First Name:</td>
<td><input type="text" name="firstName" /></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="lastName" /></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" value="Log Event" />
</td>
</tr>
</table>
</form>
</body>
</html>