Angular HTTPClient POST body not sending
Angular HTTPClient POST body not sending Currently I am trying to POST a name, email and message from an angular frontend to a php script running in the same nginx server which then runs phpmailer to send an email containing the name, email and message. Here is the code so far: import { Component, OnInit } from '@angular/core'; import { Email } from './email'; import {ContactService} from './contact.service'; import {HttpClient, HttpHeaders} from '@angular/common/http'; import {NgForm} from '@angular/forms'; const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded' }) }; const email = new Email('', '', ''); @Component({ selector: 'app-contact', templateUrl: './contact.component.html', styleUrls: ['./contact.component.css'], providers: [ContactService] }) export class ContactComponent implements OnInit { email = new Email(...