📜  typescript http 获取附加标头 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:24.028000             🧑  作者: Mango

代码示例1
const headerDict = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Access-Control-Allow-Headers': 'Content-Type',
}

const requestOptions = {                                                                                                                                                                                 
  headers: new HttpHeaders(headerDict), 
};

return this.http.get(this.heroesUrl, requestOptions)