2

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!

1 Answer 1

5

Just Change :

{username, email, first, second}

To

{username, email, plainPassword : {first, second} }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.