reuse ts class for different api calls code example
Example: typescript api request header
const headerDict = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Access-Control-Allow-Headers': 'Content-Type',
}
const requestOptions = {
headers: new Headers(headerDict),
};
return this.http.get(this.heroesUrl, requestOptions)