export class HttpService {
constructor(private http:HttpClient) {}
post(serviceName:string,date:any){
const data = {};
const headers= new HttpHeaders();
const option = { header: headers, widthCredintials:false };
const url = environment.apiUrl + serviceName;
return this.http.post(url, JSON.stringify(data),option);
}
}
错误:无过载匹配此调用选项
请帮我做什么?
检查下面的例子,希望这个能工作
post(serviceName:string,date:any){
const data = {};
const headers= new HttpHeaders();
const url = environment.apiUrl + serviceName;
return this.http.post(url, JSON.stringify(data),{ headers, withCredentials: false });
}