refactor(http): remove all facade methods from http module (#12870)

This commit is contained in:
João Dias
2016-11-15 18:19:14 +01:00
committed by Victor Berchet
parent 75277cd94b
commit 13ba2f90b9
10 changed files with 44 additions and 70 deletions

View File

@ -6,8 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
import {isPresent} from '../src/facade/lang';
import {Body} from './body';
import {ContentType, RequestMethod, ResponseContentType} from './enums';
import {Headers} from './headers';
@ -78,7 +76,7 @@ export class Request extends Body {
// TODO: assert that url is present
const url = requestOptions.url;
this.url = requestOptions.url;
if (isPresent(requestOptions.search)) {
if (requestOptions.search) {
const search = requestOptions.search.toString();
if (search.length > 0) {
let prefix = '?';
@ -93,7 +91,6 @@ export class Request extends Body {
this.method = normalizeMethodName(requestOptions.method);
// TODO(jeffbcross): implement behavior
// Defaults to 'omit', consistent with browser
// TODO(jeffbcross): implement behavior
this.headers = new Headers(requestOptions.headers);
this.contentType = this.detectContentType();
this.withCredentials = requestOptions.withCredentials;