angular-docs-cn/modules/angular2/src/http/base_response_options.ts
Jeff Cross 21568106b1 feat(http): add basic http service
This implementation only works in JavaScript, while the Observable transpilation
story gets worked out. Right now, the service just makes a simple request,
and returns an Observable of Response.

Additional functionality will be captured in separate issues.

Fixes #2028
2015-06-09 10:00:04 -07:00

24 lines
658 B
TypeScript

import {Headers} from './headers';
import {ResponseTypes} from './enums';
import {ResponseOptions} from './interfaces';
export class BaseResponseOptions implements ResponseOptions {
status: number;
headers: Headers | Object;
statusText: string;
type: ResponseTypes;
url: string;
constructor({status = 200, statusText = 'Ok', type = ResponseTypes.Default,
headers = new Headers(), url = ''}: ResponseOptions = {}) {
this.status = status;
this.statusText = statusText;
this.type = type;
this.headers = headers;
this.url = url;
}
}
;
export var baseResponseOptions = Object.freeze(new BaseResponseOptions());