Can i send http post with also RequestBody and RequestParam?? I want to send some data in that way: data - is requestbody and params is RequestParam.
var Indata = {'cityName': object.cityName };
$http({method: 'POST', url: OBJECT_REST, data: object, params: Indata}).
then(function(response) {
alert("saved");
$rootScope.$broadcast('refreshUserGrid');
$rootScope.$broadcast('clearForm');
}, function(response) {
console.log(response.status);
});
and in PostMapping controller i want to get this data:
@PostMapping(consumes = MediaType.APPLICATION_JSON)
public ResponseEntity<?> saveSportObject(@RequestBody SportObject object, @RequestParam String cityName) {
It's possible to using requestBody with RequestParam in similar way to this one?