1- import { CONST_EXPR , CONST , isPresent , isString } from 'angular2/src/core/facade/lang' ;
1+ import { isPresent , isString } from 'angular2/src/core/facade/lang' ;
22import { Headers } from './headers' ;
33import { RequestMethods } from './enums' ;
44import { RequestOptionsArgs } from './interfaces' ;
55import { Injectable } from 'angular2/src/core/di' ;
66import { URLSearchParams } from './url_search_params' ;
7+ import { normalizeMethodName } from './http_utils' ;
78
89/**
910 * Creates a request options object to be optionally provided when instantiating a
@@ -34,7 +35,7 @@ export class RequestOptions {
3435 * Http method with which to execute a {@link Request}.
3536 * Acceptable methods are defined in the {@link RequestMethods} enum.
3637 */
37- method : RequestMethods ;
38+ method : RequestMethods | string ;
3839 /**
3940 * {@link Headers } to be attached to a {@link Request }.
4041 */
@@ -53,7 +54,7 @@ export class RequestOptions {
5354 */
5455 search : URLSearchParams ;
5556 constructor ( { method, headers, body, url, search} : RequestOptionsArgs = { } ) {
56- this . method = isPresent ( method ) ? method : null ;
57+ this . method = isPresent ( method ) ? normalizeMethodName ( method ) : null ;
5758 this . headers = isPresent ( headers ) ? headers : null ;
5859 this . body = isPresent ( body ) ? body : null ;
5960 this . url = isPresent ( url ) ? url : null ;
0 commit comments