import { Observable } from 'rxjs' ; import { Inject } from '../../core' ; import { RequestOptionsArgs } from './interfaces/RequestOptionsArgs' ; import { Response } from './interfaces/Response' ; export class Http { constructor ( @ Inject ( '$http' ) private http ) { } get ( url , options ? ) { return Observable . fromPromise < Response > ( this . http . get ( url , options ) ) ; } post ( url , body , options ? ) { return Observable . fromPromise < Response > ( this . http . post ( url , body , options ) ) ; } put ( url , body , options ? ) { return Observable . fromPromise < Response > ( this . http . put ( url , body , options ) ) ; } delete ( url , options ? ) { return Observable . fromPromise < Response > ( this . http . delete ( url , options ) ) ; } patch ( url , body , options ? ) { return Observable . fromPromise < Response > ( this . http . patch ( url , body , options ) ) ; } head ( url , options ? ) { return Observable . fromPromise < Response > ( this . http . head ( url , options ) ) ; } }