Skip to content

Commit 5ce9d88

Browse files
SkyZeroZxcrisbeto
authored andcommitted
docs: Adds guide links to HTTP API docs for better discoverability
(cherry picked from commit c5e6b8b)
1 parent 1fd8592 commit 5ce9d88

File tree

7 files changed

+42
-1
lines changed

7 files changed

+42
-1
lines changed

packages/common/http/src/context.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* A token used to manipulate and access values stored in `HttpContext`.
1111
*
12+
* @see [Request and response metadata](guide/http/interceptors#request-and-response-metadata)
13+
*
1214
* @publicApi
1315
*/
1416
export class HttpContextToken<T> {
@@ -46,6 +48,8 @@ export class HttpContextToken<T> {
4648
* }).subscribe(...);
4749
* ```
4850
*
51+
* @see [Request and response metadata](guide/http/interceptors#request-and-response-metadata)
52+
*
4953
* @publicApi
5054
*/
5155
export class HttpContext {

packages/common/http/src/headers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ interface Update {
1717
* Instances are immutable. Modifying methods return a cloned
1818
* instance with the change. The original object is never changed.
1919
*
20+
* @see [Setting request headers](guide/http/making-requests#setting-request-headers)
21+
*
2022
* @publicApi
2123
*/
2224
export class HttpHeaders {

packages/common/http/src/interceptor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ function chainedInterceptorFn(
191191
* A multi-provider token that represents the array of registered
192192
* `HttpInterceptor` objects.
193193
*
194+
* @see [HTTP Guide](guide/http/interceptors)
195+
*
194196
* @publicApi
195197
*/
196198
export const HTTP_INTERCEPTORS = new InjectionToken<readonly HttpInterceptor[]>(

packages/common/http/src/params.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {RuntimeErrorCode} from './errors';
1515
*
1616
* Used by `HttpParams`.
1717
*
18+
* @see [Custom parameter encoding](guide/http/making-requests#custom-parameter-encoding)
19+
*
1820
* @publicApi
1921
**/
2022
export interface HttpParameterCodec {
@@ -129,6 +131,9 @@ interface Update {
129131
/**
130132
* Options used to construct an `HttpParams` instance.
131133
*
134+
* @see [Setting URL parameters](guide/http/making-requests#setting-url-parameters)
135+
* @see [Custom parameter encoding](guide/http/making-requests#custom-parameter-encoding)
136+
*
132137
* @publicApi
133138
*/
134139
export interface HttpParamsOptions {
@@ -153,6 +158,8 @@ export interface HttpParamsOptions {
153158
*
154159
* This class is immutable; all mutation operations return a new instance.
155160
*
161+
* @see [Setting URL parameters](guide/http/making-requests#setting-url-parameters)
162+
*
156163
* @publicApi
157164
*/
158165
export class HttpParams {

packages/common/http/src/provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function makeHttpFeature<KindT extends HttpFeatureKind>(
9494
* ```
9595
*
9696
* </div>
97-
*
97+
* @see [HTTP Client](guide/http/setup)
9898
* @see {@link withInterceptors}
9999
* @see {@link withInterceptorsFromDi}
100100
* @see {@link withXsrfConfiguration}
@@ -275,6 +275,7 @@ export function withJsonpSupport(): HttpFeature<HttpFeatureKind.JsonpSupport> {
275275
* "bubble up" until either reaching the root level or an `HttpClient` which was not configured with
276276
* this option.
277277
*
278+
* @see [HTTP client setup](guide/http/setup#withrequestsmadeviaparent)
278279
* @see {@link provideHttpClient}
279280
* @publicApi 19.0
280281
*/
@@ -300,6 +301,8 @@ export function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.Request
300301
*
301302
* Note: The Fetch API doesn't support progress report on uploads.
302303
*
304+
* @see [Advanced fetch Options](guide/http/making-requests#advanced-fetch-options)
305+
*
303306
* @publicApi
304307
*/
305308
export function withFetch(): HttpFeature<HttpFeatureKind.Fetch> {

packages/common/http/src/response.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {HttpHeaders} from './headers';
1111
/**
1212
* Type enumeration for the different kinds of `HttpEvent`.
1313
*
14+
* @see [Receiving raw progress event](guide/http/making-requests#receiving-raw-progress-events)
15+
*
1416
* @publicApi
1517
*/
1618
export enum HttpEventType {
@@ -50,6 +52,8 @@ export enum HttpEventType {
5052
/**
5153
* Base interface for progress events.
5254
*
55+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
56+
*
5357
* @publicApi
5458
*/
5559
export interface HttpProgressEvent {
@@ -73,6 +77,8 @@ export interface HttpProgressEvent {
7377
/**
7478
* A download progress event.
7579
*
80+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
81+
*
7682
* @publicApi
7783
*/
7884
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
@@ -91,6 +97,8 @@ export interface HttpDownloadProgressEvent extends HttpProgressEvent {
9197
*
9298
* Note: The `FetchBackend` doesn't support progress report on uploads.
9399
*
100+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
101+
*
94102
* @publicApi
95103
*/
96104
export interface HttpUploadProgressEvent extends HttpProgressEvent {
@@ -102,6 +110,8 @@ export interface HttpUploadProgressEvent extends HttpProgressEvent {
102110
* when a request may be retried multiple times, to distinguish between
103111
* retries on the final event stream.
104112
*
113+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
114+
*
105115
* @publicApi
106116
*/
107117
export interface HttpSentEvent {
@@ -114,6 +124,8 @@ export interface HttpSentEvent {
114124
* Grouping all custom events under this type ensures they will be handled
115125
* and forwarded by all implementations of interceptors.
116126
*
127+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
128+
*
117129
* @publicApi
118130
*/
119131
export interface HttpUserEvent<T> {
@@ -138,6 +150,7 @@ export interface HttpJsonParseError {
138150
*
139151
* Typed according to the expected type of the response.
140152
*
153+
* @see [Intercepting response events](guide/http/interceptors#intercepting-response-events)
141154
* @publicApi
142155
*/
143156
export type HttpEvent<T> =
@@ -230,6 +243,8 @@ export abstract class HttpResponseBase {
230243
* `HttpHeaderResponse` is a `HttpEvent` available on the response
231244
* event stream, only when progress events are requested.
232245
*
246+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
247+
*
233248
* @publicApi
234249
*/
235250
export class HttpHeaderResponse extends HttpResponseBase {
@@ -279,6 +294,8 @@ export class HttpHeaderResponse extends HttpResponseBase {
279294
* `HttpResponse` is a `HttpEvent` available on the response event
280295
* stream.
281296
*
297+
* @see [Interacting with the server response events](guide/http/making-requests#interacting-with-the-server-response-events)
298+
*
282299
* @publicApi
283300
*/
284301
export class HttpResponse<T> extends HttpResponseBase {
@@ -354,6 +371,8 @@ export class HttpResponse<T> extends HttpResponseBase {
354371
* will contain either a wrapped Error object or the error response returned
355372
* from the server.
356373
*
374+
* @see [Handling request failure](guide/http/making-requests#handling-request-failure)
375+
*
357376
* @publicApi
358377
*/
359378
export class HttpErrorResponse extends HttpResponseBase implements Error {

packages/common/http/src/transfer_cache.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import {HttpParams} from './params';
4343
* @param includeRequestsWithAuthHeaders Enables caching of requests containing either `Authorization`
4444
* or `Proxy-Authorization` headers. By default, these requests are excluded from caching.
4545
*
46+
* @see [Configuring the caching options](guide/ssr#configuring-the-caching-options)
47+
*
4648
* @publicApi
4749
*/
4850
export type HttpTransferCacheOptions = {
@@ -321,6 +323,8 @@ function generateHash(value: string): string {
321323
* bootstrapping of the application in the browser thus avoiding duplicate requests and reducing
322324
* load time.
323325
*
326+
* @see [Caching data when using HttpClient](guide/ssr#configuring-the-caching-options)
327+
*
324328
*/
325329
export function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[] {
326330
return [

0 commit comments

Comments
 (0)