我试图将字符串变量(City)从服务传递给控制器​​,但传递不正确

时间:2019-01-04 06:40:40

标签: angular

  getCity(){
     let headers = new Headers();

     headers.append('Content-Type', 'application/json');
     headers.append('Access-Control-Allow-Origin', '*');
     headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT');
     return this.http.get(environment.apiUrl + 'Misc/'+'City', { headers: headers})
       .pipe(map(data => data.json()),
       catchError((error: any) => {
         throw error;
       }));
   }

0 个答案:

没有答案