设置表头
//form形式private sendHttpRequest(url : string, params : any): Promise{ let Interface_Address : string = ""; //接口地址 let body = new URLSearchParams(); // let commonUser = this.cookieService.getObject('loginUserId'); // console.info(commonUser) for(let key in params){ body.set(key, params[key]); //console.log(key); //console.log(params[key]); } let headers = new Headers({'Content-Type' : 'application/x-www-form-urlencoded;charset=UTF-8'}); // headers.set("Cookies", this.cookieService.getObject('loginUserId')); //继承登录的cookie withCredentials: true let options = new RequestOptions({headers : headers, withCredentials: true}); return this.http .post( Interface_Address+url , body , options) .toPromise() .then( this.extractData );}