1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { RequestMethod, ResponseContentType } from './enums';
|
9 | import { Headers } from './headers';
|
10 | import { RequestOptionsArgs } from './interfaces';
|
11 | import { URLSearchParams } from './url_search_params';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare class RequestOptions {
|
38 | |
39 |
|
40 |
|
41 |
|
42 | method: RequestMethod | string | null;
|
43 | |
44 |
|
45 |
|
46 | headers: Headers | null;
|
47 | |
48 |
|
49 |
|
50 | body: any;
|
51 | |
52 |
|
53 |
|
54 | url: string | null;
|
55 | |
56 |
|
57 |
|
58 | params: URLSearchParams;
|
59 | |
60 |
|
61 |
|
62 | |
63 |
|
64 |
|
65 | search: URLSearchParams;
|
66 | |
67 |
|
68 |
|
69 | withCredentials: boolean | null;
|
70 | responseType: ResponseContentType | null;
|
71 | constructor(opts?: RequestOptionsArgs);
|
72 | /**
|
73 | * Creates a copy of the `RequestOptions` instance, using the optional input as values to override
|
74 | * existing values. This method will not change the values of the instance on which it is being
|
75 | * called.
|
76 | *
|
77 | * Note that `headers` and `search` will override existing values completely if present in
|
78 | * the `options` object. If these values should be merged, it should be done prior to calling
|
79 | * `merge` on the `RequestOptions` instance.
|
80 | *
|
81 | * ```typescript
|
82 | * import {RequestOptions, Request, RequestMethod} from '@angular/http';
|
83 | *
|
84 | * const options = new RequestOptions({
|
85 | * method: RequestMethod.Post
|
86 | * });
|
87 | * const req = new Request(options.merge({
|
88 | * url: 'https://google.com'
|
89 | * }));
|
90 | * console.log('req.method:', RequestMethod[req.method]);
|
91 | * console.log('options.url:', options.url);
|
92 | * console.log('req.url:', req.url);
|
93 | * ```
|
94 | */
|
95 | merge(options?: RequestOptionsArgs): RequestOptions;
|
96 | private _mergeSearchParams;
|
97 | private _parseParams;
|
98 | private _appendParam;
|
99 | }
|
100 | /**
|
101 | * Subclass of {@link RequestOptions}, with default values.
|
102 | *
|
103 | * Default values:
|
104 | * * method: {@link RequestMethod RequestMethod.Get}
|
105 | * * headers: empty {@link Headers} object
|
106 | *
|
107 | * This class could be extended and bound to the {@link RequestOptions} class
|
108 | * when configuring an {@link Injector}, in order to override the default options
|
109 | * used by {@link Http} to create and send {@link Request Requests}.
|
110 | *
|
111 | * ```typescript
|
112 | * import {BaseRequestOptions, RequestOptions} from '@angular/http';
|
113 | *
|
114 | * class MyOptions extends BaseRequestOptions {
|
115 | * search: string = 'coreTeam=true';
|
116 | * }
|
117 | *
|
118 | * {provide: RequestOptions, useClass: MyOptions};
|
119 | * ```
|
120 | *
|
121 | * The options could also be extended when manually creating a {@link Request}
|
122 | * object.
|
123 | *
|
124 | * ```
|
125 | * import {BaseRequestOptions, Request, RequestMethod} from '@angular/http';
|
126 | *
|
127 | * const options = new BaseRequestOptions();
|
128 | * const req = new Request(options.merge({
|
129 | * method: RequestMethod.Post,
|
130 | * url: 'https://google.com'
|
131 | * }));
|
132 | * console.log('req.method:', RequestMethod[req.method]);
|
133 | * console.log('options.url:', options.url);
|
134 | * console.log('req.url:', req.url);
|
135 | * ```
|
136 | *
|
137 | * @deprecated see https://angular.io/guide/http
|
138 | * @publicApi
|
139 | */
|
140 | export declare class BaseRequestOptions extends RequestOptions {
|
141 | constructor();
|
142 | }
|
143 |
|
\ | No newline at end of file |