I have been struggling to send a post request, but unfortunately the API is returning undefined. When I try to send it to my API, it shows up as [object Object]
getAccouting():Observable<any>{
// let json = this.http.get<any>('/assets/cities/altayskiy_kray/accounting.json'); if i use it json return undefined
let json;
this.http.get('/assets/cities/altayskiy_kray/accounting.json').pipe(data=>json=data);
let formData:FormData = new FormData;
formData.append('json', json);
return this.http.post<any>('http://api/api.php', formData);
}
Does anyone know how to fix this issue?