2016-06-23 16:47:54 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2015-06-24 07:27:07 +00:00
|
|
|
/**
|
|
|
|
|
* Supported http methods.
|
2016-06-27 19:27:23 +00:00
|
|
|
* @experimental
|
2015-06-24 07:27:07 +00:00
|
|
|
*/
|
2015-12-03 21:44:14 +00:00
|
|
|
export enum RequestMethod {
|
2015-08-26 20:40:12 +00:00
|
|
|
Get,
|
|
|
|
|
Post,
|
|
|
|
|
Put,
|
|
|
|
|
Delete,
|
|
|
|
|
Options,
|
|
|
|
|
Head,
|
|
|
|
|
Patch
|
2015-06-19 17:18:44 +00:00
|
|
|
}
|
2015-04-29 06:07:55 +00:00
|
|
|
|
2015-06-24 07:27:07 +00:00
|
|
|
/**
|
|
|
|
|
* All possible states in which a connection can be, based on
|
|
|
|
|
* [States](http://www.w3.org/TR/XMLHttpRequest/#states) from the `XMLHttpRequest` spec, but with an
|
|
|
|
|
* additional "CANCELLED" state.
|
2016-06-27 19:27:23 +00:00
|
|
|
* @experimental
|
2015-06-24 07:27:07 +00:00
|
|
|
*/
|
2015-12-03 21:44:14 +00:00
|
|
|
export enum ReadyState {
|
2015-08-26 20:40:12 +00:00
|
|
|
Unsent,
|
|
|
|
|
Open,
|
|
|
|
|
HeadersReceived,
|
|
|
|
|
Loading,
|
|
|
|
|
Done,
|
|
|
|
|
Cancelled
|
2015-06-19 17:18:44 +00:00
|
|
|
}
|
2015-04-29 06:07:55 +00:00
|
|
|
|
2015-06-24 07:27:07 +00:00
|
|
|
/**
|
|
|
|
|
* Acceptable response types to be associated with a {@link Response}, based on
|
|
|
|
|
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec.
|
2016-06-27 19:27:23 +00:00
|
|
|
* @experimental
|
2015-06-24 07:27:07 +00:00
|
|
|
*/
|
2015-12-03 21:44:14 +00:00
|
|
|
export enum ResponseType {
|
2015-06-19 17:18:44 +00:00
|
|
|
Basic,
|
|
|
|
|
Cors,
|
|
|
|
|
Default,
|
|
|
|
|
Error,
|
|
|
|
|
Opaque
|
|
|
|
|
}
|
2016-02-26 11:25:55 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Supported content type to be automatically associated with a {@link Request}.
|
2016-06-27 19:27:23 +00:00
|
|
|
* @experimental
|
2016-02-26 11:25:55 +00:00
|
|
|
*/
|
|
|
|
|
export enum ContentType {
|
|
|
|
|
NONE,
|
|
|
|
|
JSON,
|
|
|
|
|
FORM,
|
|
|
|
|
FORM_DATA,
|
|
|
|
|
TEXT,
|
|
|
|
|
BLOB,
|
|
|
|
|
ARRAY_BUFFER
|
|
|
|
|
}
|
2016-02-24 15:37:18 +00:00
|
|
|
|
2016-05-26 22:47:20 +00:00
|
|
|
/**
|
2016-02-24 15:37:18 +00:00
|
|
|
* Define which buffer to use to store the response
|
2016-05-26 22:47:20 +00:00
|
|
|
* @experimental
|
2016-02-24 15:37:18 +00:00
|
|
|
*/
|
2016-05-26 22:47:20 +00:00
|
|
|
export enum ResponseContentType {
|
2016-07-21 20:44:38 +00:00
|
|
|
Text,
|
2016-02-24 15:37:18 +00:00
|
|
|
Json,
|
2016-07-21 20:44:38 +00:00
|
|
|
ArrayBuffer,
|
|
|
|
|
Blob
|
2016-02-24 15:37:18 +00:00
|
|
|
}
|