Question: How can you use the HttpClient to send a POST request to an endpoint from within an addOrder function in this OrderService?

  1. this.httpClient.url(this.orderUrl).post(order);
  2. this.httpClient.send(this.orderUrl, order);
  3. this.httpClient.post(this.orderUrl, order);
  4. this.httpClient.post(this.orderUrl, order).subscribe();

Answer: The correct answer of the above question is Option D:this.httpClient.post(this.orderUrl, order).subscribe();