1
1
import { isString , isPresent , isBlank , makeTypeError } from 'angular2/src/facade/lang' ;
2
2
import { Injectable } from 'angular2/src/di/decorators' ;
3
- import { IRequestOptions , Connection , ConnectionBackend } from './interfaces' ;
3
+ import { RequestOptionsArgs , Connection , ConnectionBackend } from './interfaces' ;
4
4
import { Request } from './static_request' ;
5
5
import { BaseRequestOptions , RequestOptions } from './base_request_options' ;
6
6
import { RequestMethods } from './enums' ;
@@ -111,7 +111,7 @@ export class Http {
111
111
* object can be provided as the 2nd argument. The options object will be merged with the values
112
112
* of {@link BaseRequestOptions} before performing the request.
113
113
*/
114
- request ( url : string | Request , options ?: IRequestOptions ) : EventEmitter {
114
+ request ( url : string | Request , options ?: RequestOptionsArgs ) : EventEmitter {
115
115
var responseObservable : EventEmitter ;
116
116
if ( isString ( url ) ) {
117
117
responseObservable = httpRequest (
@@ -126,15 +126,15 @@ export class Http {
126
126
/**
127
127
* Performs a request with `get` http method.
128
128
*/
129
- get ( url : string , options ?: IRequestOptions ) : EventEmitter {
129
+ get ( url : string , options ?: RequestOptionsArgs ) : EventEmitter {
130
130
return httpRequest ( this . _backend , new Request ( mergeOptions ( this . _defaultOptions , options ,
131
131
RequestMethods . GET , url ) ) ) ;
132
132
}
133
133
134
134
/**
135
135
* Performs a request with `post` http method.
136
136
*/
137
- post ( url : string , body : string , options ?: IRequestOptions ) : EventEmitter {
137
+ post ( url : string , body : string , options ?: RequestOptionsArgs ) : EventEmitter {
138
138
return httpRequest (
139
139
this . _backend ,
140
140
new Request ( mergeOptions ( this . _defaultOptions . merge ( new RequestOptions ( { body : body } ) ) ,
@@ -144,7 +144,7 @@ export class Http {
144
144
/**
145
145
* Performs a request with `put` http method.
146
146
*/
147
- put ( url : string , body : string , options ?: IRequestOptions ) : EventEmitter {
147
+ put ( url : string , body : string , options ?: RequestOptionsArgs ) : EventEmitter {
148
148
return httpRequest (
149
149
this . _backend ,
150
150
new Request ( mergeOptions ( this . _defaultOptions . merge ( new RequestOptions ( { body : body } ) ) ,
@@ -154,15 +154,15 @@ export class Http {
154
154
/**
155
155
* Performs a request with `delete` http method.
156
156
*/
157
- delete ( url : string , options ?: IRequestOptions ) : EventEmitter {
157
+ delete ( url : string , options ?: RequestOptionsArgs ) : EventEmitter {
158
158
return httpRequest ( this . _backend , new Request ( mergeOptions ( this . _defaultOptions , options ,
159
159
RequestMethods . DELETE , url ) ) ) ;
160
160
}
161
161
162
162
/**
163
163
* Performs a request with `patch` http method.
164
164
*/
165
- patch ( url : string , body : string , options ?: IRequestOptions ) : EventEmitter {
165
+ patch ( url : string , body : string , options ?: RequestOptionsArgs ) : EventEmitter {
166
166
return httpRequest (
167
167
this . _backend ,
168
168
new Request ( mergeOptions ( this . _defaultOptions . merge ( new RequestOptions ( { body : body } ) ) ,
@@ -172,7 +172,7 @@ export class Http {
172
172
/**
173
173
* Performs a request with `head` http method.
174
174
*/
175
- head ( url : string , options ?: IRequestOptions ) : EventEmitter {
175
+ head ( url : string , options ?: RequestOptionsArgs ) : EventEmitter {
176
176
return httpRequest ( this . _backend , new Request ( mergeOptions ( this . _defaultOptions , options ,
177
177
RequestMethods . HEAD , url ) ) ) ;
178
178
}
@@ -190,7 +190,7 @@ export class Jsonp extends Http {
190
190
* object can be provided as the 2nd argument. The options object will be merged with the values
191
191
* of {@link BaseRequestOptions} before performing the request.
192
192
*/
193
- request ( url : string | Request , options ?: IRequestOptions ) : EventEmitter {
193
+ request ( url : string | Request , options ?: RequestOptionsArgs ) : EventEmitter {
194
194
var responseObservable : EventEmitter ;
195
195
if ( isString ( url ) ) {
196
196
url = new Request ( mergeOptions ( this . _defaultOptions , options , RequestMethods . GET , url ) ) ;
0 commit comments