1 |
|
2 |
|
3 |
|
4 | export interface HttpHeader {
|
5 | |
6 |
|
7 |
|
8 | name: string;
|
9 | |
10 |
|
11 |
|
12 | value: string;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 | export declare type RawHttpHeaders = {
|
18 | [headerName: string]: string;
|
19 | };
|
20 |
|
21 |
|
22 |
|
23 | export interface HttpHeadersLike {
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | set(headerName: string, headerValue: string | number): void;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 | get(headerName: string): string | undefined;
|
37 | |
38 |
|
39 |
|
40 | contains(headerName: string): boolean;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | remove(headerName: string): boolean;
|
47 | |
48 |
|
49 |
|
50 | rawHeaders(): RawHttpHeaders;
|
51 | |
52 |
|
53 |
|
54 | headersArray(): HttpHeader[];
|
55 | |
56 |
|
57 |
|
58 | headerNames(): string[];
|
59 | |
60 |
|
61 |
|
62 | headerValues(): string[];
|
63 | |
64 |
|
65 |
|
66 | clone(): HttpHeadersLike;
|
67 | |
68 |
|
69 |
|
70 |
|
71 | toJson(): RawHttpHeaders;
|
72 | }
|
73 | export declare function isHttpHeadersLike(object?: any): object is HttpHeadersLike;
|
74 |
|
75 |
|
76 |
|
77 | export declare class HttpHeaders {
|
78 | private readonly _headersMap;
|
79 | constructor(rawHeaders?: RawHttpHeaders);
|
80 | /**
|
81 | * Set a header in this collection with the provided name and value. The name is
|
82 | * case-insensitive.
|
83 | * @param headerName The name of the header to set. This value is case-insensitive.
|
84 | * @param headerValue The value of the header to set.
|
85 | */
|
86 | set(headerName: string, headerValue: string | number): void;
|
87 | /**
|
88 | * Get the header value for the provided header name, or undefined if no header exists in this
|
89 | * collection with the provided name.
|
90 | * @param headerName The name of the header.
|
91 | */
|
92 | get(headerName: string): string | undefined;
|
93 | /**
|
94 | * Get whether or not this header collection contains a header entry for the provided header name.
|
95 | */
|
96 | contains(headerName: string): boolean;
|
97 | /**
|
98 | * Remove the header with the provided headerName. Return whether or not the header existed and
|
99 | * was removed.
|
100 | * @param headerName The name of the header to remove.
|
101 | */
|
102 | remove(headerName: string): boolean;
|
103 | /**
|
104 | * Get the headers that are contained this collection as an object.
|
105 | */
|
106 | rawHeaders(): RawHttpHeaders;
|
107 | /**
|
108 | * Get the headers that are contained in this collection as an array.
|
109 | */
|
110 | headersArray(): HttpHeader[];
|
111 | /**
|
112 | * Get the header names that are contained in this collection.
|
113 | */
|
114 | headerNames(): string[];
|
115 | /**
|
116 | * Get the header names that are contained in this collection.
|
117 | */
|
118 | headerValues(): string[];
|
119 | /**
|
120 | * Get the JSON object representation of this HTTP header collection.
|
121 | */
|
122 | toJson(): RawHttpHeaders;
|
123 | /**
|
124 | * Get the string representation of this HTTP header collection.
|
125 | */
|
126 | toString(): string;
|
127 | /**
|
128 | * Create a deep clone/copy of this HttpHeaders collection.
|
129 | */
|
130 | clone(): HttpHeaders;
|
131 | }
|
132 | //# sourceMappingURL=httpHeaders.d.ts.map |
\ | No newline at end of file |