Angular 6 httpClient Post with credentials
问题 I have some code which posts some data to create a data record. It's in a service: Here's the 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