import { Injectable } from '@angular/core';
import { Http, Headers, Response, RequestOptions, } from '@angular/http';
@Injectable()
export class RoleService {
headers = new Headers({"Content-Type": "application/json"});
options = new RequestOptions({ headers: this.headers });
constructor(private http: Http) { }
getRoleList(data) {
return this.http.post('http://192.168.10.178:9080/role/getRole', data, this.options)
.toPromise()
.then(res => res.json().data)
.then(data => { return data; });
}
}
https://i.stack.imgur.com/nPiK8.pngangular4 http头文件,如何设置?
帮助我!如何解决这个问题?
请包括一个清晰的问题,有什么问题,结果是什么,等等... – Vega