Angulaire 6 httpClient Poste avec les informations d'identification

J'ai un code qui affiche certains de données pour créer un enregistrement de données.

C'est dans un service:

Voici le code:

import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

const httpOptions = {
  headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};

@Injectable({
  providedIn: 'root'
})
export class ApiService {

  constructor(private http: HttpClient) { }

  create() {
      const postedData = { userid: 1, title: 'title here', body: 'body text' };
      return this.http.post('https://jsonplaceholder.typicode.com/posts', postedData, httpOptions).subscribe(result => {
        console.log(result);
      }, error => console.log('There was an error: '));
  }

}

Ma question est...que dois-je faire ce que l'url exige de l'utilisateur d'être connecté...Comment puis-je transmettre les informations d'identification?

InformationsquelleAutor Craig2018 | 2018-05-07