HttpClient is an evolution of the existing Angular HTTP API, which exists alongside of it in a separate package, @angular/common/http. This structure ensures that existing codebases can slowly migrate to the new API. The new API improves significantly on the ergonomics and features of the legacy API. A partial list of new features includes: * Typed, synchronous response body access, including support for JSON body types * JSON is an assumed default and no longer needs to be explicitly parsed * Interceptors allow middleware logic to be inserted into the pipeline * Immutable request/response objects * Progress events for both request upload and response download * Post-request verification & flush based testing framework
		
			
				
	
	
		
			22 lines
		
	
	
		
			697 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			697 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google Inc. All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| 
 | |
| import {DOCUMENT as commonDOCUMENT} from '@angular/common';
 | |
| import {InjectionToken} from '@angular/core';
 | |
| 
 | |
| 
 | |
| /**
 | |
|  * A DI Token representing the main rendering context. In a browser this is the DOM Document.
 | |
|  *
 | |
|  * Note: Document might not be available in the Application Context when Application and Rendering
 | |
|  * Contexts are not the same (e.g. when running the application into a Web Worker).
 | |
|  *
 | |
|  * @deprecated import from `@angular/common` instead.
 | |
|  */
 | |
| export const DOCUMENT = commonDOCUMENT;
 |