I'm working with Angular5 and Symfony 3.4 with FOSUserBundle.
I have something like :
register(username: string, email: string, first: string, second: string)
{
return this.appHttp.post('register', {username, email, first, second}).subscribe(
data => {
this.appHttp.logRequest(data);
}
);
}
And what i need to send to API is a formated json like :
{
"email": "[email protected]",
"username" : "userTest",
"plainPassword" : {
"first" : "123",
"second": "123"
}
}
Currently, my json looks like :
{
"email": "[email protected]",
"username" : "userTest",
"first": "123",
"second": "123",
}
How can i post the required json ?
Thanks!