angular-docs-cn/packages/common/http/test
FDIM 1644d64398 feat(compiler-cli): introduce HttpContext request context (#25751)
A long-requested feature for HttpClient is the ability to store and retrieve
custom metadata for requests, especially in interceptors. This commit
implements this functionality via a new context object for requests.

Each outgoing HttpRequest now has an associated "context", an instance of
the HttpContext class. An HttpContext can be provided when making a request,
or if not then an empty context is created for the new request. This context
shares its lifecycle with the entire request, even across operations that
change the identity of the HttpRequest instance such as RxJS retries.

The HttpContext functions as an expando. Users can create typed tokens as instances of HttpContextToken, and
read/write a value for the key from any HttpContext object.

This commit implements the HttpContext functionality. A followup commit will
add angular.io documentation.

PR Close #25751
2021-03-15 10:33:48 -07:00
..
BUILD.bazel test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
client_spec.ts fix(common): allow number or boolean as http params (#40663) 2021-02-26 12:03:50 -08:00
context_spec.ts feat(compiler-cli): introduce HttpContext request context (#25751) 2021-03-15 10:33:48 -07:00
headers_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jsonp_mock.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jsonp_spec.ts fix(http): queue jsonp <script> tag onLoad event handler in microtask (#39512) 2020-11-17 13:09:08 -08:00
module_spec.ts feat(compiler-cli): introduce HttpContext request context (#25751) 2021-03-15 10:33:48 -07:00
params_spec.ts fix(common): allow number or boolean as http params (#40663) 2021-02-26 12:03:50 -08:00
request_spec.ts feat(compiler-cli): introduce HttpContext request context (#25751) 2021-03-15 10:33:48 -07:00
response_spec.ts test(http): use HttpStatusCode enum in tests (#23548) 2021-01-28 09:10:48 -08:00
xhr_mock.ts fix(http): emit error on XMLHttpRequest abort event (#40767) 2021-02-10 11:13:05 -08:00
xhr_spec.ts fix(http): emit error on XMLHttpRequest abort event (#40767) 2021-02-10 11:13:05 -08:00
xsrf_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00