I am new in Angular2. I am trying to call simple java REST call from Angular2. When I am posting data I am not getting error at all but my java post method is not called.
Angular2 POST-
let emplyee = JSON.stringify(this.object);
let url = 'http://localhost:8080/rest-app/rest/employeeService/insertEmployee';
console.log("Data: " + emplyee);
let headers = new Headers({'Content-Type': 'application/json'});
let options = new RequestOptions({headers: headers});
this.http.post(url, emplyee, options);
Java POST method-
@POST
@Path("/insertEmployee")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public String insertEmployee(String employee) {
logger.debug("Employee: " + employee);
return "Hello";
}