1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Observable } from 'rxjs';
|
9 | import { ResponseOptions } from '../base_response_options';
|
10 | import { ReadyState } from '../enums';
|
11 | import { Connection, ConnectionBackend, XSRFStrategy } from '../interfaces';
|
12 | import { Request } from '../static_request';
|
13 | import { Response } from '../static_response';
|
14 | import { BrowserXhr } from './browser_xhr';
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare class XHRConnection implements Connection {
|
27 | request: Request;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | response: Observable<Response>;
|
33 | readyState: ReadyState;
|
34 | constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions);
|
35 | setDetectedContentType(req: any , _xhr: any ): void;
|
36 | }
|
37 | /**
|
38 | * `XSRFConfiguration` sets up Cross Site Request Forgery (XSRF) protection for the application
|
39 | * using a cookie. See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
|
40 | * for more information on XSRF.
|
41 | *
|
42 | * Applications can configure custom cookie and header names by binding an instance of this class
|
43 | * with different `cookieName` and `headerName` values. See the main HTTP documentation for more
|
44 | * details.
|
45 | *
|
46 | * @deprecated see https://angular.io/guide/http
|
47 | * @publicApi
|
48 | */
|
49 | export declare class CookieXSRFStrategy implements XSRFStrategy {
|
50 | private _cookieName;
|
51 | private _headerName;
|
52 | constructor(_cookieName?: string, _headerName?: string);
|
53 | configureRequest(req: Request): void;
|
54 | }
|
55 | /**
|
56 | * Creates {@link XHRConnection} instances.
|
57 | *
|
58 | * This class would typically not be used by end users, but could be
|
59 | * overridden if a different backend implementation should be used,
|
60 | * such as in a node backend.
|
61 | *
|
62 | * @usageNotes
|
63 | * ### Example
|
64 | *
|
65 | * ```
|
66 | * import {Http, MyNodeBackend, HTTP_PROVIDERS, BaseRequestOptions} from '@angular/http';
|
67 | * @Component({
|
68 | * viewProviders: [
|
69 | * HTTP_PROVIDERS,
|
70 | * {provide: Http, useFactory: (backend, options) => {
|
71 | * return new Http(backend, options);
|
72 | * }, deps: [MyNodeBackend, BaseRequestOptions]}]
|
73 | * })
|
74 | * class MyComponent {
|
75 | * constructor(http:Http) {
|
76 | * http.request('people.json').subscribe(res => this.people = res.json());
|
77 | * }
|
78 | * }
|
79 | * ```
|
80 | * @deprecated see https:
|
81 | * @publicApi
|
82 | */
|
83 | export declare class XHRBackend implements ConnectionBackend {
|
84 | private _browserXHR;
|
85 | private _baseResponseOptions;
|
86 | private _xsrfStrategy;
|
87 | constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
|
88 | createConnection(request: Request): XHRConnection;
|
89 | }
|