11import { CONST_EXPR , CONST , isPresent , isString } from 'angular2/src/core/facade/lang' ;
22import { Headers } from './headers' ;
3- import { RequestModesOpts , RequestMethods , RequestCacheOpts , RequestCredentialsOpts } from './enums' ;
3+ import { RequestMethods } from './enums' ;
44import { RequestOptionsArgs } from './interfaces' ;
55import { Injectable } from 'angular2/src/core/di' ;
66import { URLSearchParams } from './url_search_params' ;
@@ -30,19 +30,12 @@ export class RequestOptions {
3030 */
3131 // TODO: support FormData, Blob, URLSearchParams
3232 body : string ;
33- mode : RequestModesOpts ;
34- credentials : RequestCredentialsOpts ;
35- cache : RequestCacheOpts ;
3633 url : string ;
3734 search : URLSearchParams ;
38- constructor ( { method, headers, body, mode, credentials, cache, url, search} :
39- RequestOptionsArgs = { } ) {
35+ constructor ( { method, headers, body, url, search} : RequestOptionsArgs = { } ) {
4036 this . method = isPresent ( method ) ? method : null ;
4137 this . headers = isPresent ( headers ) ? headers : null ;
4238 this . body = isPresent ( body ) ? body : null ;
43- this . mode = isPresent ( mode ) ? mode : null ;
44- this . credentials = isPresent ( credentials ) ? credentials : null ;
45- this . cache = isPresent ( cache ) ? cache : null ;
4639 this . url = isPresent ( url ) ? url : null ;
4740 this . search = isPresent ( search ) ? ( isString ( search ) ? new URLSearchParams ( < string > ( search ) ) :
4841 < URLSearchParams > ( search ) ) :
@@ -58,10 +51,6 @@ export class RequestOptions {
5851 method : isPresent ( options ) && isPresent ( options . method ) ? options . method : this . method ,
5952 headers : isPresent ( options ) && isPresent ( options . headers ) ? options . headers : this . headers ,
6053 body : isPresent ( options ) && isPresent ( options . body ) ? options . body : this . body ,
61- mode : isPresent ( options ) && isPresent ( options . mode ) ? options . mode : this . mode ,
62- credentials : isPresent ( options ) && isPresent ( options . credentials ) ? options . credentials :
63- this . credentials ,
64- cache : isPresent ( options ) && isPresent ( options . cache ) ? options . cache : this . cache ,
6554 url : isPresent ( options ) && isPresent ( options . url ) ? options . url : this . url ,
6655 search : isPresent ( options ) && isPresent ( options . search ) ?
6756 ( isString ( options . search ) ? new URLSearchParams ( < string > ( options . search ) ) :
@@ -91,7 +80,5 @@ export class RequestOptions {
9180 */
9281@Injectable ( )
9382export class BaseRequestOptions extends RequestOptions {
94- constructor ( ) {
95- super ( { method : RequestMethods . Get , headers : new Headers ( ) , mode : RequestModesOpts . Cors } ) ;
96- }
83+ constructor ( ) { super ( { method : RequestMethods . Get , headers : new Headers ( ) } ) ; }
9784}
0 commit comments