0
각도 (4.3+)로 새 HttpClient를 사용하여 POST (및 다른 요청 유형)에 대한 유형 검사를 사용할 수 있습니까? Angular HttpClient Typechecking Post 요청의 응답
interface ItemsResponse {
results: string[];
}
...
http.get<ItemsResponse>('/api/items').subscribe(data => {
// data is now an instance of type ItemsResponse, so you can do this:
this.results = data.results;
});
는 요청의 다른 종류의 같은 방법을 사용할 수 있습니까 : 공식 문서 (
https://angular.io/guide/http#typechecking-the-response은)에만 GET 요청을 언급?