我已經導入了標題,並且包含了對象,url和標題。但它的示值誤差類型'標題'與'RequestOptionsArgs'類型沒有共同的屬性
類型「頭」沒有共同的屬性類型「RequestOptionsArgs」
我的代碼:
getContactData(aplhaNumericId:any) {
let obj = {aplhaNumericId:aplhaNumericId};
let headers=new Headers();
headers.append('Content-Type','application/json; charset=utf=8');
return this.http.post('http://ip/ex/api/api/JsonServices.php',JSON.stringify(obj),headers)
.map((res:Response) => res.json());
}
PLS何況你的角度版本,給我們一點信息。 – asmmahmud
當然,我正在使用角度4 + –
角度4.3 +或以下?你使用'@ angular/common/http'中的HttpClient;或舊的'@角/ http'? – asmmahmud