0
let headers1 = new Headers({'Content-Type': 'application/json'});
headers1.append('X-Authorization','some code');
let options = new RequestOptions({ headers: headers1,body: {} });
this.http.get('http://locahost:8080/dmat/logmgr/v1/reports/all?calFilterType=Day&date=2017-05-05'+paramerter, options).subscribe(
(data => {
if(data.json().status === '200'){
console.log('data',data);
}else {
};
})
);
コンソールにエラーはありません。しかし、私はクロムの[ネットワーク]タブの[要求されたヘッダ]タブで自分のヘッダを見ることができません。
これは私のサービスファイル プライベートヘッダーです。 \tコンストラクタ(プライベートhttp:Http){ this.headers = new Headers(); } \tプライベートgetReports = 'レポート/すべて?calFilterType =日&日付= 2017-05-05'; getLogData(パラメータ:any){ //this.headers.append('Content-Type '、' application/json '); this.headers.append( 'X-Authorization'、 'SOME TOKEN'); \t \t戻り値this.http.get(this.Url + this.getReports +パラメータ、{headers:this.headers}).map((res:Response)=> res.json()); } –
これは私が 公共getLogData(値:任意)は、このサービスを呼び出すAM WHERE FROM MY CompoNetをファイルである{ this.logManagerService.getLogData(値).subscribe(=データ データ=> { this.testResponse; コンソール.log( "私はここにデータを見ることができません"、this.testResponse); } ); –