feat: deprecate @angular/http in favor of @angular/common/http (#18906)
As of 5.0, @angular/http is deprecated. @angular/common/http will be the official HTTP API in Angular going forward. PR Close #18906
This commit is contained in:
parent
1ef558b57c
commit
72c7b6edea
|
@ -20,7 +20,7 @@ import {HttpEvent} from './response';
|
||||||
*
|
*
|
||||||
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class HttpHandler {
|
export abstract class HttpHandler {
|
||||||
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
||||||
|
@ -34,7 +34,7 @@ export abstract class HttpHandler {
|
||||||
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
||||||
* through the interceptor chain.
|
* through the interceptor chain.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class HttpBackend implements HttpHandler {
|
export abstract class HttpBackend implements HttpHandler {
|
||||||
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
||||||
|
|
|
@ -46,7 +46,7 @@ function addBody<T>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export type HttpObserve = 'body' | 'events' | 'response';
|
export type HttpObserve = 'body' | 'events' | 'response';
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export type HttpObserve = 'body' | 'events' | 'response';
|
||||||
* Each request method has multiple signatures, and the return type varies according to which
|
* Each request method has multiple signatures, and the return type varies according to which
|
||||||
* signature is called (mainly the values of `observe` and `responseType`).
|
* signature is called (mainly the values of `observe` and `responseType`).
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpClient {
|
export class HttpClient {
|
||||||
|
|
|
@ -14,7 +14,7 @@ interface Update {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable set of Http headers, with lazy parsing.
|
* Immutable set of Http headers, with lazy parsing.
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpHeaders {
|
export class HttpHeaders {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {HttpEvent} from './response';
|
||||||
* In rare cases, interceptors may wish to completely handle a request themselves,
|
* In rare cases, interceptors may wish to completely handle a request themselves,
|
||||||
* and not delegate to the remainder of the chain. This behavior is allowed.
|
* and not delegate to the remainder of the chain. This behavior is allowed.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpInterceptor {
|
export interface HttpInterceptor {
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +47,7 @@ export interface HttpInterceptor {
|
||||||
/**
|
/**
|
||||||
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpInterceptorHandler implements HttpHandler {
|
export class HttpInterceptorHandler implements HttpHandler {
|
||||||
constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {}
|
constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {}
|
||||||
|
@ -61,7 +61,7 @@ export class HttpInterceptorHandler implements HttpHandler {
|
||||||
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
||||||
* are registered.
|
* are registered.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export const HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS');
|
export const HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS');
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ export const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json respo
|
||||||
*
|
*
|
||||||
* In the browser, this should always be the `window` object.
|
* In the browser, this should always be the `window` object.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class JsonpCallbackContext { [key: string]: (data: any) => void; }
|
export abstract class JsonpCallbackContext { [key: string]: (data: any) => void; }
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export abstract class JsonpCallbackContext { [key: string]: (data: any) => void;
|
||||||
* `HttpBackend` that only processes `HttpRequest` with the JSONP method,
|
* `HttpBackend` that only processes `HttpRequest` with the JSONP method,
|
||||||
* by performing JSONP style requests.
|
* by performing JSONP style requests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JsonpClientBackend implements HttpBackend {
|
export class JsonpClientBackend implements HttpBackend {
|
||||||
|
@ -207,7 +207,7 @@ export class JsonpClientBackend implements HttpBackend {
|
||||||
* An `HttpInterceptor` which identifies requests with the method JSONP and
|
* An `HttpInterceptor` which identifies requests with the method JSONP and
|
||||||
* shifts them to the `JsonpClientBackend`.
|
* shifts them to the `JsonpClientBackend`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JsonpInterceptor {
|
export class JsonpInterceptor {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {HttpXsrfCookieExtractor, HttpXsrfInterceptor, HttpXsrfTokenExtractor, XS
|
||||||
*
|
*
|
||||||
* Meant to be used as a factory function within `HttpClientModule`.
|
* Meant to be used as a factory function within `HttpClientModule`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export function interceptingHandler(
|
export function interceptingHandler(
|
||||||
backend: HttpBackend, interceptors: HttpInterceptor[] | null = []): HttpHandler {
|
backend: HttpBackend, interceptors: HttpInterceptor[] | null = []): HttpHandler {
|
||||||
|
@ -40,7 +40,7 @@ export function interceptingHandler(
|
||||||
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
|
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
|
||||||
* in test environments. In that case, callbacks are stored on an anonymous object instead.
|
* in test environments. In that case, callbacks are stored on an anonymous object instead.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export function jsonpCallbackContext(): Object {
|
export function jsonpCallbackContext(): Object {
|
||||||
if (typeof window === 'object') {
|
if (typeof window === 'object') {
|
||||||
|
@ -59,7 +59,7 @@ export function jsonpCallbackContext(): Object {
|
||||||
* If no such names are provided, the default is to use `X-XSRF-TOKEN` for
|
* If no such names are provided, the default is to use `X-XSRF-TOKEN` for
|
||||||
* the header name and `XSRF-TOKEN` for the cookie name.
|
* the header name and `XSRF-TOKEN` for the cookie name.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [
|
providers: [
|
||||||
|
@ -107,7 +107,7 @@ export class HttpClientXsrfModule {
|
||||||
* Interceptors can be added to the chain behind `HttpClient` by binding them
|
* Interceptors can be added to the chain behind `HttpClient` by binding them
|
||||||
* to the multiprovider for `HTTP_INTERCEPTORS`.
|
* to the multiprovider for `HTTP_INTERCEPTORS`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -140,7 +140,7 @@ export class HttpClientModule {
|
||||||
* Without this module, Jsonp requests will reach the backend
|
* Without this module, Jsonp requests will reach the backend
|
||||||
* with method JSONP, where they'll be rejected.
|
* with method JSONP, where they'll be rejected.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
*
|
*
|
||||||
* Used by `HttpParams`.
|
* Used by `HttpParams`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
**/
|
**/
|
||||||
export interface HttpParameterCodec {
|
export interface HttpParameterCodec {
|
||||||
encodeKey(key: string): string;
|
encodeKey(key: string): string;
|
||||||
|
@ -25,7 +25,7 @@ export interface HttpParameterCodec {
|
||||||
* A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
|
* A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
|
||||||
* serialize and parse URL parameter keys and values.
|
* serialize and parse URL parameter keys and values.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpUrlEncodingCodec implements HttpParameterCodec {
|
export class HttpUrlEncodingCodec implements HttpParameterCodec {
|
||||||
encodeKey(k: string): string { return standardEncoding(k); }
|
encodeKey(k: string): string { return standardEncoding(k); }
|
||||||
|
@ -79,7 +79,7 @@ interface Update {
|
||||||
*
|
*
|
||||||
* This class is immutable - all mutation operations return a new instance.
|
* This class is immutable - all mutation operations return a new instance.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpParams {
|
export class HttpParams {
|
||||||
private map: Map<string, string[]>|null;
|
private map: Map<string, string[]>|null;
|
||||||
|
|
|
@ -73,7 +73,7 @@ function isFormData(value: any): value is FormData {
|
||||||
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
|
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
|
||||||
* method should be used.
|
* method should be used.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpRequest<T> {
|
export class HttpRequest<T> {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {HttpHeaders} from './headers';
|
||||||
/**
|
/**
|
||||||
* Type enumeration for the different kinds of `HttpEvent`.
|
* Type enumeration for the different kinds of `HttpEvent`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export enum HttpEventType {
|
export enum HttpEventType {
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +48,7 @@ export enum HttpEventType {
|
||||||
/**
|
/**
|
||||||
* Base interface for progress events.
|
* Base interface for progress events.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpProgressEvent {
|
export interface HttpProgressEvent {
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +71,7 @@ export interface HttpProgressEvent {
|
||||||
/**
|
/**
|
||||||
* A download progress event.
|
* A download progress event.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
|
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
|
||||||
type: HttpEventType.DownloadProgress;
|
type: HttpEventType.DownloadProgress;
|
||||||
|
@ -87,7 +87,7 @@ export interface HttpDownloadProgressEvent extends HttpProgressEvent {
|
||||||
/**
|
/**
|
||||||
* An upload progress event.
|
* An upload progress event.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpUploadProgressEvent extends HttpProgressEvent {
|
export interface HttpUploadProgressEvent extends HttpProgressEvent {
|
||||||
type: HttpEventType.UploadProgress;
|
type: HttpEventType.UploadProgress;
|
||||||
|
@ -98,7 +98,7 @@ export interface HttpUploadProgressEvent extends HttpProgressEvent {
|
||||||
* when a request may be retried multiple times, to distinguish between
|
* when a request may be retried multiple times, to distinguish between
|
||||||
* retries on the final event stream.
|
* retries on the final event stream.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpSentEvent { type: HttpEventType.Sent; }
|
export interface HttpSentEvent { type: HttpEventType.Sent; }
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ export interface HttpSentEvent { type: HttpEventType.Sent; }
|
||||||
* Grouping all custom events under this type ensures they will be handled
|
* Grouping all custom events under this type ensures they will be handled
|
||||||
* and forwarded by all implementations of interceptors.
|
* and forwarded by all implementations of interceptors.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpUserEvent<T> { type: HttpEventType.User; }
|
export interface HttpUserEvent<T> { type: HttpEventType.User; }
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ export interface HttpUserEvent<T> { type: HttpEventType.User; }
|
||||||
*
|
*
|
||||||
* It bundles the Error object with the actual response body that failed to parse.
|
* It bundles the Error object with the actual response body that failed to parse.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface HttpJsonParseError {
|
export interface HttpJsonParseError {
|
||||||
error: Error;
|
error: Error;
|
||||||
|
@ -130,7 +130,7 @@ export interface HttpJsonParseError {
|
||||||
*
|
*
|
||||||
* Typed according to the expected type of the response.
|
* Typed according to the expected type of the response.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export type HttpEvent<T> =
|
export type HttpEvent<T> =
|
||||||
HttpSentEvent | HttpHeaderResponse | HttpResponse<T>| HttpProgressEvent | HttpUserEvent<T>;
|
HttpSentEvent | HttpHeaderResponse | HttpResponse<T>| HttpProgressEvent | HttpUserEvent<T>;
|
||||||
|
@ -138,7 +138,7 @@ export type HttpEvent<T> =
|
||||||
/**
|
/**
|
||||||
* Base class for both `HttpResponse` and `HttpHeaderResponse`.
|
* Base class for both `HttpResponse` and `HttpHeaderResponse`.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class HttpResponseBase {
|
export abstract class HttpResponseBase {
|
||||||
/**
|
/**
|
||||||
|
@ -206,7 +206,7 @@ export abstract class HttpResponseBase {
|
||||||
* `HttpHeaderResponse` is a `HttpEvent` available on the response
|
* `HttpHeaderResponse` is a `HttpEvent` available on the response
|
||||||
* event stream, only when progress events are requested.
|
* event stream, only when progress events are requested.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpHeaderResponse extends HttpResponseBase {
|
export class HttpHeaderResponse extends HttpResponseBase {
|
||||||
/**
|
/**
|
||||||
|
@ -247,7 +247,7 @@ export class HttpHeaderResponse extends HttpResponseBase {
|
||||||
* `HttpResponse` is a `HttpEvent` available on the response event
|
* `HttpResponse` is a `HttpEvent` available on the response event
|
||||||
* stream.
|
* stream.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpResponse<T> extends HttpResponseBase {
|
export class HttpResponse<T> extends HttpResponseBase {
|
||||||
/**
|
/**
|
||||||
|
@ -297,7 +297,7 @@ export class HttpResponse<T> extends HttpResponseBase {
|
||||||
* will contain either a wrapped Error object or the error response returned
|
* will contain either a wrapped Error object or the error response returned
|
||||||
* from the server.
|
* from the server.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class HttpErrorResponse extends HttpResponseBase implements Error {
|
export class HttpErrorResponse extends HttpResponseBase implements Error {
|
||||||
readonly name = 'HttpErrorResponse';
|
readonly name = 'HttpErrorResponse';
|
||||||
|
|
|
@ -34,14 +34,14 @@ function getResponseUrl(xhr: any): string|null {
|
||||||
/**
|
/**
|
||||||
* A wrapper around the `XMLHttpRequest` constructor.
|
* A wrapper around the `XMLHttpRequest` constructor.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class XhrFactory { abstract build(): XMLHttpRequest; }
|
export abstract class XhrFactory { abstract build(): XMLHttpRequest; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A factory for @{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.
|
* A factory for @{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BrowserXhr implements XhrFactory {
|
export class BrowserXhr implements XhrFactory {
|
||||||
|
@ -63,7 +63,7 @@ interface PartialResponse {
|
||||||
* An `HttpBackend` which uses the XMLHttpRequest API to send
|
* An `HttpBackend` which uses the XMLHttpRequest API to send
|
||||||
* requests to a backend server.
|
* requests to a backend server.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpXhrBackend implements HttpBackend {
|
export class HttpXhrBackend implements HttpBackend {
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const XSRF_HEADER_NAME = new InjectionToken<string>('XSRF_HEADER_NAME');
|
||||||
/**
|
/**
|
||||||
* Retrieves the current XSRF token to use with the next outgoing request.
|
* Retrieves the current XSRF token to use with the next outgoing request.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class HttpXsrfTokenExtractor {
|
export abstract class HttpXsrfTokenExtractor {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {TestRequest} from './request';
|
||||||
/**
|
/**
|
||||||
* Defines a matcher for requests based on URL, method, or both.
|
* Defines a matcher for requests based on URL, method, or both.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export interface RequestMatch {
|
export interface RequestMatch {
|
||||||
method?: string;
|
method?: string;
|
||||||
|
@ -24,7 +24,7 @@ export interface RequestMatch {
|
||||||
* Controller to be injected into tests, that allows for mocking and flushing
|
* Controller to be injected into tests, that allows for mocking and flushing
|
||||||
* of requests.
|
* of requests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class HttpTestingController {
|
export abstract class HttpTestingController {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,7 +25,7 @@ import {TestRequest} from './request';
|
||||||
* requests were made and then flush them. In the end, a verify() method asserts
|
* requests were made and then flush them. In the end, a verify() method asserts
|
||||||
* that no unexpected requests were made.
|
* that no unexpected requests were made.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpClientTestingBackend implements HttpBackend, HttpTestingController {
|
export class HttpClientTestingBackend implements HttpBackend, HttpTestingController {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {HttpClientTestingBackend} from './backend';
|
||||||
*
|
*
|
||||||
* Inject `HttpTestingController` to expect and flush requests in your tests.
|
* Inject `HttpTestingController` to expect and flush requests in your tests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {Observer} from 'rxjs/Observer';
|
||||||
* This interface allows access to the underlying `HttpRequest`, and allows
|
* This interface allows access to the underlying `HttpRequest`, and allows
|
||||||
* responding with `HttpEvent`s or `HttpErrorResponse`s.
|
* responding with `HttpEvent`s or `HttpErrorResponse`s.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @stable
|
||||||
*/
|
*/
|
||||||
export class TestRequest {
|
export class TestRequest {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {Injectable} from '@angular/core';
|
||||||
*
|
*
|
||||||
* Take care not to evaluate this in non-browser contexts.
|
* Take care not to evaluate this in non-browser contexts.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BrowserXhr {
|
export class BrowserXhr {
|
||||||
|
|
|
@ -24,7 +24,7 @@ const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.';
|
||||||
/**
|
/**
|
||||||
* Abstract base class for an in-flight JSONP request.
|
* Abstract base class for an in-flight JSONP request.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export abstract class JSONPConnection implements Connection {
|
export abstract class JSONPConnection implements Connection {
|
||||||
/**
|
/**
|
||||||
|
@ -141,7 +141,7 @@ export class JSONPConnection_ extends JSONPConnection {
|
||||||
/**
|
/**
|
||||||
* A {@link ConnectionBackend} that uses the JSONP strategy of making requests.
|
* A {@link ConnectionBackend} that uses the JSONP strategy of making requests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export abstract class JSONPBackend extends ConnectionBackend {}
|
export abstract class JSONPBackend extends ConnectionBackend {}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ const XSSI_PREFIX = /^\)\]\}',?\n/;
|
||||||
* This class would typically not be created or interacted with directly inside applications, though
|
* This class would typically not be created or interacted with directly inside applications, though
|
||||||
* the {@link MockConnection} may be interacted with in tests.
|
* the {@link MockConnection} may be interacted with in tests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class XHRConnection implements Connection {
|
export class XHRConnection implements Connection {
|
||||||
request: Request;
|
request: Request;
|
||||||
|
@ -188,7 +188,7 @@ export class XHRConnection implements Connection {
|
||||||
* with different `cookieName` and `headerName` values. See the main HTTP documentation for more
|
* with different `cookieName` and `headerName` values. See the main HTTP documentation for more
|
||||||
* details.
|
* details.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class CookieXSRFStrategy implements XSRFStrategy {
|
export class CookieXSRFStrategy implements XSRFStrategy {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -226,7 +226,7 @@ export class CookieXSRFStrategy implements XSRFStrategy {
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class XHRBackend implements ConnectionBackend {
|
export class XHRBackend implements ConnectionBackend {
|
||||||
|
|
|
@ -37,7 +37,7 @@ import {URLSearchParams} from './url_search_params';
|
||||||
* console.log('options.url:', options.url); // https://google.com
|
* console.log('options.url:', options.url); // https://google.com
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class RequestOptions {
|
export class RequestOptions {
|
||||||
/**
|
/**
|
||||||
|
@ -200,7 +200,7 @@ export class RequestOptions {
|
||||||
* console.log('req.url:', req.url); // https://google.com
|
* console.log('req.url:', req.url); // https://google.com
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BaseRequestOptions extends RequestOptions {
|
export class BaseRequestOptions extends RequestOptions {
|
||||||
|
|
|
@ -39,7 +39,7 @@ import {ResponseOptionsArgs} from './interfaces';
|
||||||
* console.log('res.json():', res.json()); // Object {name: "Jeff"}
|
* console.log('res.json():', res.json()); // Object {name: "Jeff"}
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class ResponseOptions {
|
export class ResponseOptions {
|
||||||
// TODO: FormData | Blob
|
// TODO: FormData | Blob
|
||||||
|
@ -156,7 +156,7 @@ export class ResponseOptions {
|
||||||
* console.log('res.text():', res.text()); // Angular;
|
* console.log('res.text():', res.text()); // Angular;
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BaseResponseOptions extends ResponseOptions {
|
export class BaseResponseOptions extends ResponseOptions {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supported http methods.
|
* Supported http methods.
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export enum RequestMethod {
|
export enum RequestMethod {
|
||||||
Get,
|
Get,
|
||||||
|
@ -24,7 +24,7 @@ export enum RequestMethod {
|
||||||
* All possible states in which a connection can be, based on
|
* 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
|
* [States](http://www.w3.org/TR/XMLHttpRequest/#states) from the `XMLHttpRequest` spec, but with an
|
||||||
* additional "CANCELLED" state.
|
* additional "CANCELLED" state.
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export enum ReadyState {
|
export enum ReadyState {
|
||||||
Unsent,
|
Unsent,
|
||||||
|
@ -38,7 +38,7 @@ export enum ReadyState {
|
||||||
/**
|
/**
|
||||||
* Acceptable response types to be associated with a {@link Response}, based on
|
* Acceptable response types to be associated with a {@link Response}, based on
|
||||||
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec.
|
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec.
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export enum ResponseType {
|
export enum ResponseType {
|
||||||
Basic,
|
Basic,
|
||||||
|
@ -50,7 +50,7 @@ export enum ResponseType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supported content type to be automatically associated with a {@link Request}.
|
* Supported content type to be automatically associated with a {@link Request}.
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export enum ContentType {
|
export enum ContentType {
|
||||||
NONE,
|
NONE,
|
||||||
|
@ -64,7 +64,7 @@ export enum ContentType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define which buffer to use to store the response
|
* Define which buffer to use to store the response
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export enum ResponseContentType {
|
export enum ResponseContentType {
|
||||||
Text,
|
Text,
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
* console.log(thirdHeaders.get('X-My-Custom-Header')); //'Angular'
|
* console.log(thirdHeaders.get('X-My-Custom-Header')); //'Angular'
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class Headers {
|
export class Headers {
|
||||||
/** @internal header names are lower case */
|
/** @internal header names are lower case */
|
||||||
|
|
|
@ -98,7 +98,7 @@ function mergeOptions(
|
||||||
* http.get('request-from-mock-backend.json').subscribe((res:Response) => doSomething(res));
|
* http.get('request-from-mock-backend.json').subscribe((res:Response) => doSomething(res));
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Http {
|
export class Http {
|
||||||
|
@ -186,7 +186,7 @@ export class Http {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Jsonp extends Http {
|
export class Jsonp extends Http {
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function jsonpFactory(jsonpBackend: JSONPBackend, requestOptions: Request
|
||||||
/**
|
/**
|
||||||
* The module that includes http's providers
|
* The module that includes http's providers
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [
|
providers: [
|
||||||
|
@ -60,7 +60,7 @@ export class HttpModule {
|
||||||
/**
|
/**
|
||||||
* The module that includes jsonp's providers
|
* The module that includes jsonp's providers
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -17,14 +17,14 @@ import {URLSearchParams} from './url_search_params';
|
||||||
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
|
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
|
||||||
* {@link Request}.
|
* {@link Request}.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export abstract class ConnectionBackend { abstract createConnection(request: any): Connection; }
|
export abstract class ConnectionBackend { abstract createConnection(request: any): Connection; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class from which real connections are derived.
|
* Abstract class from which real connections are derived.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export abstract class Connection {
|
export abstract class Connection {
|
||||||
readyState: ReadyState;
|
readyState: ReadyState;
|
||||||
|
@ -35,7 +35,7 @@ export abstract class Connection {
|
||||||
/**
|
/**
|
||||||
* An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request.
|
* An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export abstract class XSRFStrategy { abstract configureRequest(req: Request): void; }
|
export abstract class XSRFStrategy { abstract configureRequest(req: Request): void; }
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export abstract class XSRFStrategy { abstract configureRequest(req: Request): vo
|
||||||
* Interface for options to construct a RequestOptions, based on
|
* Interface for options to construct a RequestOptions, based on
|
||||||
* [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec.
|
* [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export interface RequestOptionsArgs {
|
export interface RequestOptionsArgs {
|
||||||
url?: string|null;
|
url?: string|null;
|
||||||
|
@ -66,7 +66,7 @@ export interface RequestArgs extends RequestOptionsArgs { url: string|null; }
|
||||||
* Interface for options to construct a Response, based on
|
* Interface for options to construct a Response, based on
|
||||||
* [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec.
|
* [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export interface ResponseOptionsArgs {
|
export interface ResponseOptionsArgs {
|
||||||
body?: string|Object|FormData|ArrayBuffer|Blob|null;
|
body?: string|Object|FormData|ArrayBuffer|Blob|null;
|
||||||
|
|
|
@ -52,7 +52,7 @@ import {URLSearchParams} from './url_search_params';
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class Request extends Body {
|
export class Request extends Body {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ import {Headers} from './headers';
|
||||||
* can be accessed many times. There are other differences in the implementation, but this is the
|
* can be accessed many times. There are other differences in the implementation, but this is the
|
||||||
* most significant.
|
* most significant.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class Response extends Body {
|
export class Response extends Body {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,7 +22,7 @@ function paramParser(rawParams: string = ''): Map<string, string[]> {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
**/
|
**/
|
||||||
export class QueryEncoder {
|
export class QueryEncoder {
|
||||||
encodeKey(k: string): string { return standardEncoding(k); }
|
encodeKey(k: string): string { return standardEncoding(k); }
|
||||||
|
@ -76,7 +76,7 @@ function standardEncoding(v: string): string {
|
||||||
*
|
*
|
||||||
* let params = new URLSearchParams('', new MyQueryEncoder());
|
* let params = new URLSearchParams('', new MyQueryEncoder());
|
||||||
* ```
|
* ```
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class URLSearchParams {
|
export class URLSearchParams {
|
||||||
paramsMap: Map<string, string[]>;
|
paramsMap: Map<string, string[]>;
|
||||||
|
|
|
@ -14,6 +14,6 @@
|
||||||
|
|
||||||
import {Version} from '@angular/core';
|
import {Version} from '@angular/core';
|
||||||
/**
|
/**
|
||||||
* @stable
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export const VERSION = new Version('0.0.0-PLACEHOLDER');
|
export const VERSION = new Version('0.0.0-PLACEHOLDER');
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {take} from 'rxjs/operator/take';
|
||||||
*
|
*
|
||||||
* Mock Connection to represent a {@link Connection} for tests.
|
* Mock Connection to represent a {@link Connection} for tests.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
export class MockConnection implements Connection {
|
export class MockConnection implements Connection {
|
||||||
// TODO Name `readyState` should change to be more generic, and states could be made to be more
|
// TODO Name `readyState` should change to be more generic, and states could be made to be more
|
||||||
|
@ -190,7 +190,7 @@ export class MockConnection implements Connection {
|
||||||
*
|
*
|
||||||
* This method only exists in the mock implementation, not in real Backends.
|
* This method only exists in the mock implementation, not in real Backends.
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated use @angular/common/http instead
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MockBackend implements ConnectionBackend {
|
export class MockBackend implements ConnectionBackend {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
|
export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class HttpBackend implements HttpHandler {
|
export declare abstract class HttpBackend implements HttpHandler {
|
||||||
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpClient {
|
export declare class HttpClient {
|
||||||
constructor(handler: HttpHandler);
|
constructor(handler: HttpHandler);
|
||||||
delete<T>(url: string, options?: {
|
delete<T>(url: string, options?: {
|
||||||
|
@ -996,15 +996,15 @@ export declare class HttpClient {
|
||||||
}): Observable<any>;
|
}): Observable<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpClientJsonpModule {
|
export declare class HttpClientJsonpModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpClientModule {
|
export declare class HttpClientModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpClientXsrfModule {
|
export declare class HttpClientXsrfModule {
|
||||||
static disable(): ModuleWithProviders;
|
static disable(): ModuleWithProviders;
|
||||||
static withOptions(options?: {
|
static withOptions(options?: {
|
||||||
|
@ -1013,13 +1013,13 @@ export declare class HttpClientXsrfModule {
|
||||||
}): ModuleWithProviders;
|
}): ModuleWithProviders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
|
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
|
||||||
partialText?: string;
|
partialText?: string;
|
||||||
type: HttpEventType.DownloadProgress;
|
type: HttpEventType.DownloadProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpErrorResponse extends HttpResponseBase implements Error {
|
export declare class HttpErrorResponse extends HttpResponseBase implements Error {
|
||||||
readonly error: any | null;
|
readonly error: any | null;
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
|
@ -1034,10 +1034,10 @@ export declare class HttpErrorResponse extends HttpResponseBase implements Error
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare type HttpEvent<T> = HttpSentEvent | HttpHeaderResponse | HttpResponse<T> | HttpProgressEvent | HttpUserEvent<T>;
|
export declare type HttpEvent<T> = HttpSentEvent | HttpHeaderResponse | HttpResponse<T> | HttpProgressEvent | HttpUserEvent<T>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare enum HttpEventType {
|
export declare enum HttpEventType {
|
||||||
Sent = 0,
|
Sent = 0,
|
||||||
UploadProgress = 1,
|
UploadProgress = 1,
|
||||||
|
@ -1047,12 +1047,12 @@ export declare enum HttpEventType {
|
||||||
User = 5,
|
User = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class HttpHandler {
|
export declare abstract class HttpHandler {
|
||||||
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpHeaderResponse extends HttpResponseBase {
|
export declare class HttpHeaderResponse extends HttpResponseBase {
|
||||||
readonly type: HttpEventType.ResponseHeader;
|
readonly type: HttpEventType.ResponseHeader;
|
||||||
constructor(init?: {
|
constructor(init?: {
|
||||||
|
@ -1069,7 +1069,7 @@ export declare class HttpHeaderResponse extends HttpResponseBase {
|
||||||
}): HttpHeaderResponse;
|
}): HttpHeaderResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpHeaders {
|
export declare class HttpHeaders {
|
||||||
constructor(headers?: string | {
|
constructor(headers?: string | {
|
||||||
[name: string]: string | string[];
|
[name: string]: string | string[];
|
||||||
|
@ -1083,12 +1083,12 @@ export declare class HttpHeaders {
|
||||||
set(name: string, value: string | string[]): HttpHeaders;
|
set(name: string, value: string | string[]): HttpHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpInterceptor {
|
export interface HttpInterceptor {
|
||||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpParameterCodec {
|
export interface HttpParameterCodec {
|
||||||
decodeKey(key: string): string;
|
decodeKey(key: string): string;
|
||||||
decodeValue(value: string): string;
|
decodeValue(value: string): string;
|
||||||
|
@ -1096,7 +1096,7 @@ export interface HttpParameterCodec {
|
||||||
encodeValue(value: string): string;
|
encodeValue(value: string): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpParams {
|
export declare class HttpParams {
|
||||||
constructor(options?: {
|
constructor(options?: {
|
||||||
fromString?: string;
|
fromString?: string;
|
||||||
|
@ -1112,14 +1112,14 @@ export declare class HttpParams {
|
||||||
toString(): string;
|
toString(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpProgressEvent {
|
export interface HttpProgressEvent {
|
||||||
loaded: number;
|
loaded: number;
|
||||||
total?: number;
|
total?: number;
|
||||||
type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
|
type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpRequest<T> {
|
export declare class HttpRequest<T> {
|
||||||
readonly body: T | null;
|
readonly body: T | null;
|
||||||
readonly headers: HttpHeaders;
|
readonly headers: HttpHeaders;
|
||||||
|
@ -1188,7 +1188,7 @@ export declare class HttpRequest<T> {
|
||||||
serializeBody(): ArrayBuffer | Blob | FormData | string | null;
|
serializeBody(): ArrayBuffer | Blob | FormData | string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpResponse<T> extends HttpResponseBase {
|
export declare class HttpResponse<T> extends HttpResponseBase {
|
||||||
readonly body: T | null;
|
readonly body: T | null;
|
||||||
readonly type: HttpEventType.Response;
|
readonly type: HttpEventType.Response;
|
||||||
|
@ -1215,7 +1215,7 @@ export declare class HttpResponse<T> extends HttpResponseBase {
|
||||||
}): HttpResponse<V>;
|
}): HttpResponse<V>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class HttpResponseBase {
|
export declare abstract class HttpResponseBase {
|
||||||
readonly headers: HttpHeaders;
|
readonly headers: HttpHeaders;
|
||||||
readonly ok: boolean;
|
readonly ok: boolean;
|
||||||
|
@ -1231,12 +1231,12 @@ export declare abstract class HttpResponseBase {
|
||||||
}, defaultStatus?: number, defaultStatusText?: string);
|
}, defaultStatus?: number, defaultStatusText?: string);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpSentEvent {
|
export interface HttpSentEvent {
|
||||||
type: HttpEventType.Sent;
|
type: HttpEventType.Sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
|
export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
|
||||||
decodeKey(k: string): string;
|
decodeKey(k: string): string;
|
||||||
decodeValue(v: string): string;
|
decodeValue(v: string): string;
|
||||||
|
@ -1244,35 +1244,35 @@ export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
|
||||||
encodeValue(v: string): string;
|
encodeValue(v: string): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface HttpUserEvent<T> {
|
export interface HttpUserEvent<T> {
|
||||||
type: HttpEventType.User;
|
type: HttpEventType.User;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpXhrBackend implements HttpBackend {
|
export declare class HttpXhrBackend implements HttpBackend {
|
||||||
constructor(xhrFactory: XhrFactory);
|
constructor(xhrFactory: XhrFactory);
|
||||||
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class HttpXsrfTokenExtractor {
|
export declare abstract class HttpXsrfTokenExtractor {
|
||||||
abstract getToken(): string | null;
|
abstract getToken(): string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class JsonpClientBackend implements HttpBackend {
|
export declare class JsonpClientBackend implements HttpBackend {
|
||||||
constructor(callbackMap: JsonpCallbackContext, document: any);
|
constructor(callbackMap: JsonpCallbackContext, document: any);
|
||||||
handle(req: HttpRequest<never>): Observable<HttpEvent<any>>;
|
handle(req: HttpRequest<never>): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class JsonpInterceptor {
|
export declare class JsonpInterceptor {
|
||||||
constructor(jsonp: JsonpClientBackend);
|
constructor(jsonp: JsonpClientBackend);
|
||||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class XhrFactory {
|
export declare abstract class XhrFactory {
|
||||||
abstract build(): XMLHttpRequest;
|
abstract build(): XMLHttpRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class HttpClientTestingModule {
|
export declare class HttpClientTestingModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare abstract class HttpTestingController {
|
export declare abstract class HttpTestingController {
|
||||||
abstract expectNone(url: string, description?: string): void;
|
abstract expectNone(url: string, description?: string): void;
|
||||||
abstract expectNone(params: RequestMatch, description?: string): void;
|
abstract expectNone(params: RequestMatch, description?: string): void;
|
||||||
|
@ -18,13 +18,13 @@ export declare abstract class HttpTestingController {
|
||||||
}): void;
|
}): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export interface RequestMatch {
|
export interface RequestMatch {
|
||||||
method?: string;
|
method?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @stable */
|
||||||
export declare class TestRequest {
|
export declare class TestRequest {
|
||||||
readonly cancelled: boolean;
|
readonly cancelled: boolean;
|
||||||
request: HttpRequest<any>;
|
request: HttpRequest<any>;
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class BaseRequestOptions extends RequestOptions {
|
export declare class BaseRequestOptions extends RequestOptions {
|
||||||
constructor();
|
constructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class BaseResponseOptions extends ResponseOptions {
|
export declare class BaseResponseOptions extends ResponseOptions {
|
||||||
constructor();
|
constructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class BrowserXhr {
|
export declare class BrowserXhr {
|
||||||
constructor();
|
constructor();
|
||||||
build(): any;
|
build(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class Connection {
|
export declare abstract class Connection {
|
||||||
readyState: ReadyState;
|
readyState: ReadyState;
|
||||||
request: Request;
|
request: Request;
|
||||||
response: any;
|
response: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class ConnectionBackend {
|
export declare abstract class ConnectionBackend {
|
||||||
abstract createConnection(request: any): Connection;
|
abstract createConnection(request: any): Connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class CookieXSRFStrategy implements XSRFStrategy {
|
export declare class CookieXSRFStrategy implements XSRFStrategy {
|
||||||
constructor(_cookieName?: string, _headerName?: string);
|
constructor(_cookieName?: string, _headerName?: string);
|
||||||
configureRequest(req: Request): void;
|
configureRequest(req: Request): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class Headers {
|
export declare class Headers {
|
||||||
constructor(headers?: Headers | {
|
constructor(headers?: Headers | {
|
||||||
[name: string]: any;
|
[name: string]: any;
|
||||||
|
@ -53,7 +53,7 @@ export declare class Headers {
|
||||||
static fromResponseHeaderString(headersString: string): Headers;
|
static fromResponseHeaderString(headersString: string): Headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class Http {
|
export declare class Http {
|
||||||
protected _backend: ConnectionBackend;
|
protected _backend: ConnectionBackend;
|
||||||
protected _defaultOptions: RequestOptions;
|
protected _defaultOptions: RequestOptions;
|
||||||
|
@ -68,21 +68,21 @@ export declare class Http {
|
||||||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class HttpModule {
|
export declare class HttpModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class Jsonp extends Http {
|
export declare class Jsonp extends Http {
|
||||||
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions);
|
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions);
|
||||||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class JSONPBackend extends ConnectionBackend {
|
export declare abstract class JSONPBackend extends ConnectionBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class JSONPConnection implements Connection {
|
export declare abstract class JSONPConnection implements Connection {
|
||||||
readyState: ReadyState;
|
readyState: ReadyState;
|
||||||
request: Request;
|
request: Request;
|
||||||
|
@ -90,17 +90,17 @@ export declare abstract class JSONPConnection implements Connection {
|
||||||
abstract finished(data?: any): void;
|
abstract finished(data?: any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class JsonpModule {
|
export declare class JsonpModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class QueryEncoder {
|
export declare class QueryEncoder {
|
||||||
encodeKey(k: string): string;
|
encodeKey(k: string): string;
|
||||||
encodeValue(v: string): string;
|
encodeValue(v: string): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare enum ReadyState {
|
export declare enum ReadyState {
|
||||||
Unsent = 0,
|
Unsent = 0,
|
||||||
Open = 1,
|
Open = 1,
|
||||||
|
@ -110,7 +110,7 @@ export declare enum ReadyState {
|
||||||
Cancelled = 5,
|
Cancelled = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class Request extends Body {
|
export declare class Request extends Body {
|
||||||
headers: Headers;
|
headers: Headers;
|
||||||
method: RequestMethod;
|
method: RequestMethod;
|
||||||
|
@ -123,7 +123,7 @@ export declare class Request extends Body {
|
||||||
getBody(): any;
|
getBody(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare enum RequestMethod {
|
export declare enum RequestMethod {
|
||||||
Get = 0,
|
Get = 0,
|
||||||
Post = 1,
|
Post = 1,
|
||||||
|
@ -134,7 +134,7 @@ export declare enum RequestMethod {
|
||||||
Patch = 6,
|
Patch = 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class RequestOptions {
|
export declare class RequestOptions {
|
||||||
body: any;
|
body: any;
|
||||||
headers: Headers | null;
|
headers: Headers | null;
|
||||||
|
@ -148,7 +148,7 @@ export declare class RequestOptions {
|
||||||
merge(options?: RequestOptionsArgs): RequestOptions;
|
merge(options?: RequestOptionsArgs): RequestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export interface RequestOptionsArgs {
|
export interface RequestOptionsArgs {
|
||||||
body?: any;
|
body?: any;
|
||||||
headers?: Headers | null;
|
headers?: Headers | null;
|
||||||
|
@ -164,7 +164,7 @@ export interface RequestOptionsArgs {
|
||||||
withCredentials?: boolean | null;
|
withCredentials?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class Response extends Body {
|
export declare class Response extends Body {
|
||||||
bytesLoaded: number;
|
bytesLoaded: number;
|
||||||
headers: Headers | null;
|
headers: Headers | null;
|
||||||
|
@ -178,7 +178,7 @@ export declare class Response extends Body {
|
||||||
toString(): string;
|
toString(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare enum ResponseContentType {
|
export declare enum ResponseContentType {
|
||||||
Text = 0,
|
Text = 0,
|
||||||
Json = 1,
|
Json = 1,
|
||||||
|
@ -186,7 +186,7 @@ export declare enum ResponseContentType {
|
||||||
Blob = 3,
|
Blob = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class ResponseOptions {
|
export declare class ResponseOptions {
|
||||||
body: string | Object | ArrayBuffer | Blob | null;
|
body: string | Object | ArrayBuffer | Blob | null;
|
||||||
headers: Headers | null;
|
headers: Headers | null;
|
||||||
|
@ -196,7 +196,7 @@ export declare class ResponseOptions {
|
||||||
merge(options?: ResponseOptionsArgs): ResponseOptions;
|
merge(options?: ResponseOptionsArgs): ResponseOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export interface ResponseOptionsArgs {
|
export interface ResponseOptionsArgs {
|
||||||
body?: string | Object | FormData | ArrayBuffer | Blob | null;
|
body?: string | Object | FormData | ArrayBuffer | Blob | null;
|
||||||
headers?: Headers | null;
|
headers?: Headers | null;
|
||||||
|
@ -206,7 +206,7 @@ export interface ResponseOptionsArgs {
|
||||||
url?: string | null;
|
url?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare enum ResponseType {
|
export declare enum ResponseType {
|
||||||
Basic = 0,
|
Basic = 0,
|
||||||
Cors = 1,
|
Cors = 1,
|
||||||
|
@ -215,7 +215,7 @@ export declare enum ResponseType {
|
||||||
Opaque = 4,
|
Opaque = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class URLSearchParams {
|
export declare class URLSearchParams {
|
||||||
paramsMap: Map<string, string[]>;
|
paramsMap: Map<string, string[]>;
|
||||||
rawParams: string;
|
rawParams: string;
|
||||||
|
@ -233,16 +233,16 @@ export declare class URLSearchParams {
|
||||||
toString(): string;
|
toString(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @deprecated */
|
||||||
export declare const VERSION: Version;
|
export declare const VERSION: Version;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class XHRBackend implements ConnectionBackend {
|
export declare class XHRBackend implements ConnectionBackend {
|
||||||
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
|
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
|
||||||
createConnection(request: Request): XHRConnection;
|
createConnection(request: Request): XHRConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class XHRConnection implements Connection {
|
export declare class XHRConnection implements Connection {
|
||||||
readyState: ReadyState;
|
readyState: ReadyState;
|
||||||
request: Request;
|
request: Request;
|
||||||
|
@ -251,7 +251,7 @@ export declare class XHRConnection implements Connection {
|
||||||
setDetectedContentType(req: any, _xhr: any): void;
|
setDetectedContentType(req: any, _xhr: any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class XSRFStrategy {
|
export declare abstract class XSRFStrategy {
|
||||||
abstract configureRequest(req: Request): void;
|
abstract configureRequest(req: Request): void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class MockBackend implements ConnectionBackend {
|
export declare class MockBackend implements ConnectionBackend {
|
||||||
connections: any;
|
connections: any;
|
||||||
connectionsArray: MockConnection[];
|
connectionsArray: MockConnection[];
|
||||||
|
@ -9,7 +9,7 @@ export declare class MockBackend implements ConnectionBackend {
|
||||||
verifyNoPendingRequests(): void;
|
verifyNoPendingRequests(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class MockConnection implements Connection {
|
export declare class MockConnection implements Connection {
|
||||||
readyState: ReadyState;
|
readyState: ReadyState;
|
||||||
request: Request;
|
request: Request;
|
||||||
|
|
Loading…
Reference in New Issue