I am currently using angular 4 to build my web application.In that i am getting the data via rest calls to webservices,when i post data i want to know if i can change the body presentation (second param in post method) with an object so the instruction will be easier.
updatePasswordWithObservable(userToAdd:User) {
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
this.http.post(this.updatePwdUrl,
{
"internalId": 0,
"oldPwd": "",
"pwd": "123",
"reset": true,
"userEntry": {
"activeNotifications": true,
"aspects": [
{
"aspectName": "string",
"internalId": 0
}
],
"email": "[email protected]",
"enabled": true,
"lastName": "waaaa",
"login": "[email protected]",
"name": "souad12219",
"phone": ""
}
}
) .subscribe( res => { console.log(res); }, err => { console.log("Error occured"); } ); }