11/// <reference path="../../typings/rx/rx.all.d.ts" />
22
33import { Injectable } from 'angular2/src/di/decorators' ;
4- import { RequestOptions , Connection } from './interfaces' ;
4+ import { IRequestOptions , Connection } from './interfaces' ;
55import { Request } from './static_request' ;
66import { Response } from './static_response' ;
77import { XHRBackend } from './backends/xhr_backend' ;
@@ -61,44 +61,44 @@ function httpRequest(backend: XHRBackend, request: Request) {
6161export class Http {
6262 constructor ( private backend : XHRBackend , private defaultOptions : BaseRequestOptions ) { }
6363
64- request ( url : string | Request , options ?: RequestOptions ) : Rx . Observable < Response > {
64+ request ( url : string | Request , options ?: IRequestOptions ) : Rx . Observable < Response > {
6565 if ( typeof url === 'string' ) {
6666 return httpRequest ( this . backend , new Request ( url , this . defaultOptions . merge ( options ) ) ) ;
6767 } else if ( url instanceof Request ) {
6868 return httpRequest ( this . backend , url ) ;
6969 }
7070 }
7171
72- get ( url : string , options ?: RequestOptions ) {
72+ get ( url : string , options ?: IRequestOptions ) {
7373 return httpRequest ( this . backend , new Request ( url , this . defaultOptions . merge ( options )
7474 . merge ( { method : RequestMethods . GET } ) ) ) ;
7575 }
7676
77- post ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: RequestOptions ) {
77+ post ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: IRequestOptions ) {
7878 return httpRequest ( this . backend ,
7979 new Request ( url , this . defaultOptions . merge ( options )
8080
8181 . merge ( { body : body , method : RequestMethods . POST } ) ) ) ;
8282 }
8383
84- put ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: RequestOptions ) {
84+ put ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: IRequestOptions ) {
8585 return httpRequest ( this . backend ,
8686 new Request ( url , this . defaultOptions . merge ( options )
8787 . merge ( { body : body , method : RequestMethods . PUT } ) ) ) ;
8888 }
8989
90- delete ( url : string , options ?: RequestOptions ) {
90+ delete ( url : string , options ?: IRequestOptions ) {
9191 return httpRequest ( this . backend , new Request ( url , this . defaultOptions . merge ( options )
9292 . merge ( { method : RequestMethods . DELETE } ) ) ) ;
9393 }
9494
95- patch ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: RequestOptions ) {
95+ patch ( url : string , body : URLSearchParams | FormData | Blob | string , options ?: IRequestOptions ) {
9696 return httpRequest ( this . backend ,
9797 new Request ( url , this . defaultOptions . merge ( options )
9898 . merge ( { body : body , method : RequestMethods . PATCH } ) ) ) ;
9999 }
100100
101- head ( url : string , options ?: RequestOptions ) {
101+ head ( url : string , options ?: IRequestOptions ) {
102102 return httpRequest ( this . backend , new Request ( url , this . defaultOptions . merge ( options )
103103 . merge ( { method : RequestMethods . HEAD } ) ) ) ;
104104 }
@@ -111,7 +111,7 @@ if (Rx.hasOwnProperty('default')) {
111111 Observable = Rx . Observable ;
112112}
113113export function HttpFactory ( backend : XHRBackend , defaultOptions : BaseRequestOptions ) {
114- return function ( url : string | Request , options ?: RequestOptions ) {
114+ return function ( url : string | Request , options ?: IRequestOptions ) {
115115 if ( typeof url === 'string' ) {
116116 return httpRequest ( backend , new Request ( url , defaultOptions . merge ( options ) ) ) ;
117117 } else if ( url instanceof Request ) {
0 commit comments