1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Headers } from './headers';
|
9 | import { ResponseOptionsArgs } from './interfaces';
|
10 |
|
11 |
|
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 |
|
38 |
|
39 |
|
40 | export declare class ResponseOptions {
|
41 | |
42 |
|
43 |
|
44 | body: string | Object | ArrayBuffer | Blob | null;
|
45 | |
46 |
|
47 |
|
48 |
|
49 | status: number | null;
|
50 | |
51 |
|
52 |
|
53 | headers: Headers | null;
|
54 | url: string | null;
|
55 | constructor(opts?: ResponseOptionsArgs);
|
56 | /**
|
57 | * Creates a copy of the `ResponseOptions` instance, using the optional input as values to
|
58 | * override
|
59 | * existing values. This method will not change the values of the instance on which it is being
|
60 | * called.
|
61 | *
|
62 | * This may be useful when sharing a base `ResponseOptions` object inside tests,
|
63 | * where certain properties may change from test to test.
|
64 | *
|
65 | * @usageNotes
|
66 | * ### Example
|
67 | *
|
68 | * ```typescript
|
69 | * import {ResponseOptions, Response} from '@angular/http';
|
70 | *
|
71 | * var options = new ResponseOptions({
|
72 | * body: {name: 'Jeff'}
|
73 | * });
|
74 | * var res = new Response(options.merge({
|
75 | * url: 'https://google.com'
|
76 | * }));
|
77 | * console.log('options.url:', options.url);
|
78 | * console.log('res.json():', res.json());
|
79 | * console.log('res.url:', res.url);
|
80 | * ```
|
81 | */
|
82 | merge(options?: ResponseOptionsArgs): ResponseOptions;
|
83 | }
|
84 | /**
|
85 | * Subclass of {@link ResponseOptions}, with default values.
|
86 | *
|
87 | * Default values:
|
88 | * * status: 200
|
89 | * * headers: empty {@link Headers} object
|
90 | *
|
91 | * This class could be extended and bound to the {@link ResponseOptions} class
|
92 | * when configuring an {@link Injector}, in order to override the default options
|
93 | * used by {@link Http} to create {@link Response Responses}.
|
94 | *
|
95 | * @usageNotes
|
96 | * ### Example
|
97 | *
|
98 | * ```typescript
|
99 | * import {provide} from '@angular/core';
|
100 | * import {bootstrap} from '@angular/platform-browser/browser';
|
101 | * import {HTTP_PROVIDERS, Headers, Http, BaseResponseOptions, ResponseOptions} from
|
102 | * '@angular/http';
|
103 | * import {App} from './myapp';
|
104 | *
|
105 | * class MyOptions extends BaseResponseOptions {
|
106 | * headers:Headers = new Headers({network: 'github'});
|
107 | * }
|
108 | *
|
109 | * bootstrap(App, [HTTP_PROVIDERS, {provide: ResponseOptions, useClass: MyOptions}]);
|
110 | * ```
|
111 | *
|
112 | * The options could also be extended when manually creating a {@link Response}
|
113 | * object.
|
114 | *
|
115 | * ### Example
|
116 | *
|
117 | * ```
|
118 | * import {BaseResponseOptions, Response} from '@angular/http';
|
119 | *
|
120 | * var options = new BaseResponseOptions();
|
121 | * var res = new Response(options.merge({
|
122 | * body: 'Angular',
|
123 | * headers: new Headers({framework: 'angular'})
|
124 | * }));
|
125 | * console.log('res.headers.get("framework"):', res.headers.get('framework'));
|
126 | * console.log('res.text():', res.text());
|
127 | * ```
|
128 | *
|
129 | * @deprecated see https://angular.io/guide/http
|
130 | * @publicApi
|
131 | */
|
132 | export declare class BaseResponseOptions extends ResponseOptions {
|
133 | constructor();
|
134 | }
|
135 |
|
\ | No newline at end of file |