Skip to content

Commit 72c7b6e

Browse files
alxhubmhevery
authored andcommitted
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
1 parent 1ef558b commit 72c7b6e

34 files changed

+136
-136
lines changed

packages/common/http/src/backend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {HttpEvent} from './response';
2020
*
2121
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
2222
*
23-
* @experimental
23+
* @stable
2424
*/
2525
export abstract class HttpHandler {
2626
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
@@ -34,7 +34,7 @@ export abstract class HttpHandler {
3434
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
3535
* through the interceptor chain.
3636
*
37-
* @experimental
37+
* @stable
3838
*/
3939
export abstract class HttpBackend implements HttpHandler {
4040
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;

packages/common/http/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function addBody<T>(
4646
}
4747

4848
/**
49-
* @experimental
49+
* @stable
5050
*/
5151
export type HttpObserve = 'body' | 'events' | 'response';
5252

@@ -57,7 +57,7 @@ export type HttpObserve = 'body' | 'events' | 'response';
5757
* Each request method has multiple signatures, and the return type varies according to which
5858
* signature is called (mainly the values of `observe` and `responseType`).
5959
*
60-
* @experimental
60+
* @stable
6161
*/
6262
@Injectable()
6363
export class HttpClient {

packages/common/http/src/headers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface Update {
1414

1515
/**
1616
* Immutable set of Http headers, with lazy parsing.
17-
* @experimental
17+
* @stable
1818
*/
1919
export class HttpHeaders {
2020
/**

packages/common/http/src/interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {HttpEvent} from './response';
2222
* In rare cases, interceptors may wish to completely handle a request themselves,
2323
* and not delegate to the remainder of the chain. This behavior is allowed.
2424
*
25-
* @experimental
25+
* @stable
2626
*/
2727
export interface HttpInterceptor {
2828
/**
@@ -47,7 +47,7 @@ export interface HttpInterceptor {
4747
/**
4848
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
4949
*
50-
* @experimental
50+
* @stable
5151
*/
5252
export class HttpInterceptorHandler implements HttpHandler {
5353
constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {}
@@ -61,7 +61,7 @@ export class HttpInterceptorHandler implements HttpHandler {
6161
* A multi-provider token which represents the array of `HttpInterceptor`s that
6262
* are registered.
6363
*
64-
* @experimental
64+
* @stable
6565
*/
6666
export const HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS');
6767

packages/common/http/src/jsonp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json respo
3535
*
3636
* In the browser, this should always be the `window` object.
3737
*
38-
* @experimental
38+
* @stable
3939
*/
4040
export abstract class JsonpCallbackContext { [key: string]: (data: any) => void; }
4141

4242
/**
4343
* `HttpBackend` that only processes `HttpRequest` with the JSONP method,
4444
* by performing JSONP style requests.
4545
*
46-
* @experimental
46+
* @stable
4747
*/
4848
@Injectable()
4949
export class JsonpClientBackend implements HttpBackend {
@@ -207,7 +207,7 @@ export class JsonpClientBackend implements HttpBackend {
207207
* An `HttpInterceptor` which identifies requests with the method JSONP and
208208
* shifts them to the `JsonpClientBackend`.
209209
*
210-
* @experimental
210+
* @stable
211211
*/
212212
@Injectable()
213213
export class JsonpInterceptor {

packages/common/http/src/module.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {HttpXsrfCookieExtractor, HttpXsrfInterceptor, HttpXsrfTokenExtractor, XS
2323
*
2424
* Meant to be used as a factory function within `HttpClientModule`.
2525
*
26-
* @experimental
26+
* @stable
2727
*/
2828
export function interceptingHandler(
2929
backend: HttpBackend, interceptors: HttpInterceptor[] | null = []): HttpHandler {
@@ -40,7 +40,7 @@ export function interceptingHandler(
4040
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
4141
* in test environments. In that case, callbacks are stored on an anonymous object instead.
4242
*
43-
* @experimental
43+
* @stable
4444
*/
4545
export function jsonpCallbackContext(): Object {
4646
if (typeof window === 'object') {
@@ -59,7 +59,7 @@ export function jsonpCallbackContext(): Object {
5959
* If no such names are provided, the default is to use `X-XSRF-TOKEN` for
6060
* the header name and `XSRF-TOKEN` for the cookie name.
6161
*
62-
* @experimental
62+
* @stable
6363
*/
6464
@NgModule({
6565
providers: [
@@ -107,7 +107,7 @@ export class HttpClientXsrfModule {
107107
* Interceptors can be added to the chain behind `HttpClient` by binding them
108108
* to the multiprovider for `HTTP_INTERCEPTORS`.
109109
*
110-
* @experimental
110+
* @stable
111111
*/
112112
@NgModule({
113113
imports: [
@@ -140,7 +140,7 @@ export class HttpClientModule {
140140
* Without this module, Jsonp requests will reach the backend
141141
* with method JSONP, where they'll be rejected.
142142
*
143-
* @experimental
143+
* @stable
144144
*/
145145
@NgModule({
146146
providers: [

packages/common/http/src/params.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* Used by `HttpParams`.
1313
*
14-
* @experimental
14+
* @stable
1515
**/
1616
export interface HttpParameterCodec {
1717
encodeKey(key: string): string;
@@ -25,7 +25,7 @@ export interface HttpParameterCodec {
2525
* A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
2626
* serialize and parse URL parameter keys and values.
2727
*
28-
* @experimental
28+
* @stable
2929
*/
3030
export class HttpUrlEncodingCodec implements HttpParameterCodec {
3131
encodeKey(k: string): string { return standardEncoding(k); }
@@ -79,7 +79,7 @@ interface Update {
7979
*
8080
* This class is immutable - all mutation operations return a new instance.
8181
*
82-
* @experimental
82+
* @stable
8383
*/
8484
export class HttpParams {
8585
private map: Map<string, string[]>|null;

packages/common/http/src/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function isFormData(value: any): value is FormData {
7373
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
7474
* method should be used.
7575
*
76-
* @experimental
76+
* @stable
7777
*/
7878
export class HttpRequest<T> {
7979
/**

packages/common/http/src/response.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {HttpHeaders} from './headers';
1111
/**
1212
* Type enumeration for the different kinds of `HttpEvent`.
1313
*
14-
* @experimental
14+
* @stable
1515
*/
1616
export enum HttpEventType {
1717
/**
@@ -48,7 +48,7 @@ export enum HttpEventType {
4848
/**
4949
* Base interface for progress events.
5050
*
51-
* @experimental
51+
* @stable
5252
*/
5353
export interface HttpProgressEvent {
5454
/**
@@ -71,7 +71,7 @@ export interface HttpProgressEvent {
7171
/**
7272
* A download progress event.
7373
*
74-
* @experimental
74+
* @stable
7575
*/
7676
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
7777
type: HttpEventType.DownloadProgress;
@@ -87,7 +87,7 @@ export interface HttpDownloadProgressEvent extends HttpProgressEvent {
8787
/**
8888
* An upload progress event.
8989
*
90-
* @experimental
90+
* @stable
9191
*/
9292
export interface HttpUploadProgressEvent extends HttpProgressEvent {
9393
type: HttpEventType.UploadProgress;
@@ -98,7 +98,7 @@ export interface HttpUploadProgressEvent extends HttpProgressEvent {
9898
* when a request may be retried multiple times, to distinguish between
9999
* retries on the final event stream.
100100
*
101-
* @experimental
101+
* @stable
102102
*/
103103
export interface HttpSentEvent { type: HttpEventType.Sent; }
104104

@@ -108,7 +108,7 @@ export interface HttpSentEvent { type: HttpEventType.Sent; }
108108
* Grouping all custom events under this type ensures they will be handled
109109
* and forwarded by all implementations of interceptors.
110110
*
111-
* @experimental
111+
* @stable
112112
*/
113113
export interface HttpUserEvent<T> { type: HttpEventType.User; }
114114

@@ -118,7 +118,7 @@ export interface HttpUserEvent<T> { type: HttpEventType.User; }
118118
*
119119
* It bundles the Error object with the actual response body that failed to parse.
120120
*
121-
* @experimental
121+
* @stable
122122
*/
123123
export interface HttpJsonParseError {
124124
error: Error;
@@ -130,15 +130,15 @@ export interface HttpJsonParseError {
130130
*
131131
* Typed according to the expected type of the response.
132132
*
133-
* @experimental
133+
* @stable
134134
*/
135135
export type HttpEvent<T> =
136136
HttpSentEvent | HttpHeaderResponse | HttpResponse<T>| HttpProgressEvent | HttpUserEvent<T>;
137137

138138
/**
139139
* Base class for both `HttpResponse` and `HttpHeaderResponse`.
140140
*
141-
* @experimental
141+
* @stable
142142
*/
143143
export abstract class HttpResponseBase {
144144
/**
@@ -206,7 +206,7 @@ export abstract class HttpResponseBase {
206206
* `HttpHeaderResponse` is a `HttpEvent` available on the response
207207
* event stream, only when progress events are requested.
208208
*
209-
* @experimental
209+
* @stable
210210
*/
211211
export class HttpHeaderResponse extends HttpResponseBase {
212212
/**
@@ -247,7 +247,7 @@ export class HttpHeaderResponse extends HttpResponseBase {
247247
* `HttpResponse` is a `HttpEvent` available on the response event
248248
* stream.
249249
*
250-
* @experimental
250+
* @stable
251251
*/
252252
export class HttpResponse<T> extends HttpResponseBase {
253253
/**
@@ -297,7 +297,7 @@ export class HttpResponse<T> extends HttpResponseBase {
297297
* will contain either a wrapped Error object or the error response returned
298298
* from the server.
299299
*
300-
* @experimental
300+
* @stable
301301
*/
302302
export class HttpErrorResponse extends HttpResponseBase implements Error {
303303
readonly name = 'HttpErrorResponse';

packages/common/http/src/xhr.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ function getResponseUrl(xhr: any): string|null {
3434
/**
3535
* A wrapper around the `XMLHttpRequest` constructor.
3636
*
37-
* @experimental
37+
* @stable
3838
*/
3939
export abstract class XhrFactory { abstract build(): XMLHttpRequest; }
4040

4141
/**
4242
* A factory for @{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.
4343
*
44-
* @experimental
44+
* @stable
4545
*/
4646
@Injectable()
4747
export class BrowserXhr implements XhrFactory {
@@ -63,7 +63,7 @@ interface PartialResponse {
6363
* An `HttpBackend` which uses the XMLHttpRequest API to send
6464
* requests to a backend server.
6565
*
66-
* @experimental
66+
* @stable
6767
*/
6868
@Injectable()
6969
export class HttpXhrBackend implements HttpBackend {

0 commit comments

Comments
 (0)