Skip to content

Commit c5e6b8b

Browse files
SkyZeroZxcrisbeto
authored andcommitted
docs: Adds guide links to HTTP API docs for better discoverability
1 parent e155a1e commit c5e6b8b

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
@@ -187,6 +187,8 @@ export function chainedInterceptorFn(
187187
* A multi-provider token that represents the array of registered
188188
* `HttpInterceptor` objects.
189189
*
190+
* @see [HTTP Guide](guide/http/interceptors)
191+
*
190192
* @publicApi
191193
*/
192194
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
@@ -82,7 +82,7 @@ function makeHttpFeature<KindT extends HttpFeatureKind>(
8282
* ```
8383
*
8484
* </div>
85-
*
85+
* @see [HTTP Client](guide/http/setup)
8686
* @see {@link withInterceptors}
8787
* @see {@link withInterceptorsFromDi}
8888
* @see {@link withXsrfConfiguration}
@@ -260,6 +260,7 @@ export function withJsonpSupport(): HttpFeature<HttpFeatureKind.JsonpSupport> {
260260
* "bubble up" until either reaching the root level or an `HttpClient` which was not configured with
261261
* this option.
262262
*
263+
* @see [HTTP client setup](guide/http/setup#withrequestsmadeviaparent)
263264
* @see {@link provideHttpClient}
264265
* @publicApi 19.0
265266
*/
@@ -285,6 +286,8 @@ export function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.Request
285286
*
286287
* Note: The Fetch API doesn't support progress report on uploads.
287288
*
289+
* @see [Advanced fetch Options](guide/http/making-requests#advanced-fetch-options)
290+
*
288291
* @publicApi
289292
*/
290293
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> =
@@ -248,6 +261,8 @@ export abstract class HttpResponseBase {
248261
* `HttpHeaderResponse` is a `HttpEvent` available on the response
249262
* event stream, only when progress events are requested.
250263
*
264+
* @see [Receiving raw progress events](guide/http/making-requests#receiving-raw-progress-events)
265+
*
251266
* @publicApi
252267
*/
253268
export class HttpHeaderResponse extends HttpResponseBase {
@@ -297,6 +312,8 @@ export class HttpHeaderResponse extends HttpResponseBase {
297312
* `HttpResponse` is a `HttpEvent` available on the response event
298313
* stream.
299314
*
315+
* @see [Interacting with the server response events](guide/http/making-requests#interacting-with-the-server-response-events)
316+
*
300317
* @publicApi
301318
*/
302319
export class HttpResponse<T> extends HttpResponseBase {
@@ -377,6 +394,8 @@ export class HttpResponse<T> extends HttpResponseBase {
377394
* will contain either a wrapped Error object or the error response returned
378395
* from the server.
379396
*
397+
* @see [Handling request failure](guide/http/making-requests#handling-request-failure)
398+
*
380399
* @publicApi
381400
*/
382401
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)