Answers for "Cannot find name 'HttpHeaders'"

-1

typescript http get attach headers

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)
Posted by: Guest on March-04-2020
0

Cannot find name 'HttpHeaders'

import { HttpHeaders } from '@angular/common/http';
Posted by: Guest on September-24-2021

Code answers related to "Cannot find name 'HttpHeaders'"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language