How is it possible to post form data to an external rest api?
At the moment i have an html form:
<form [formGroup] = form (ngSubmit) = onSubmit(form.value)>
<input name=name formControlName=name>
<input name=first_name formControlName=first_name>
<input name=last_name formControlName=last_name>
<button type=submit>Save</button>
</form>
and then i have the function that is handling the submit in my component.ts file:
onSubmit = function (user) {
console.log(user);
//this.http.post('http://xxx/externalapi/add', user);
}
But how is it possible to post the form data to my external api? And what is the standard of sending form data with angular? Is it just a simple post request with form data as queryParams or is it standard to convert it into JSON. I can modify the api to handle whatever data is sent so thats not a problem.