feat(http): Add support for strings as http method names

Closes #4331
This commit is contained in:
mgechev
2015-09-21 10:46:16 +03:00
committed by Jeff Cross
parent a251df9df4
commit 34518f0f2d
5 changed files with 46 additions and 6 deletions
+2 -2
View File
@@ -1,6 +1,7 @@
import {RequestMethods} from './enums';
import {RequestOptions} from './base_request_options';
import {Headers} from './headers';
import {normalizeMethodName} from './http_utils';
import {
RegExpWrapper,
CONST_EXPR,
@@ -9,7 +10,6 @@ import {
StringWrapper
} from 'angular2/src/core/facade/lang';
// TODO(jeffbcross): properly implement body accessors
/**
* Creates `Request` instances from provided values.
@@ -77,7 +77,7 @@ export class Request {
}
}
this._body = requestOptions.body;
this.method = requestOptions.method;
this.method = normalizeMethodName(requestOptions.method);
// TODO(jeffbcross): implement behavior
// Defaults to 'omit', consistent with browser
// TODO(jeffbcross): implement behavior