import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; @Injectable() export class BaseHttpService { constructor( protected http: HttpClient ) { } get(url: string, options?: Object): Observable { return this.http.get(url, options); } post(url: string, body: any, options?: Object): Observable { return this.http.post(url, body, options); } put(url: string, body: any, options?: Object): Observable { return this.http.put(url, body, options); } delete(url: string, options?: Object): Observable { return this.http.delete(url, options); } patch(url: string, body: any, options?: Object): Observable { return this.http.patch(url, body, options); } head(url: string, options?: Object): Observable { return this.http.head(url, options); } options(url: string, options?: Object): Observable { return this.http.options(url, options); } }