Below is my TypeScript object:
{
first_name:"test",
last_name: "test",
birthdate:"2018-01-08T16:00:00.000Z",
contactNumber: "12312312312",
email:"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e195849295a195849295cf828e8c">[email protected]</a>",
username:user."test",
password: user."test"
}
VERSUS
{
"first_name":"test",
"last_name": "tests",
"birthdate":"2018-01-08T16:00:00.000Z",
"contactNumber": "31231232131",
"email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afcac2cec6c3efc8c2cec6c381ccc0c2">[email protected]</a>",
"username":"test",
"password":"test1234"
}
Whenever I make an HTTP POST request with this object using Angular 5, it triggers an error on the API side.
The error message is as follows:
Unpermitted parameters: :first_name, :last_name, :birthdate, :contactNumber, :user
To resolve this issue, adding double quotes to all keys in the object fixes the problem.