mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Fixed & Imporoved AxiosHeaders class (#5224)
* Refactored AxiosHeaders class; * Added support for instances of AxiosHeaders as a value for the headers option; Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Vendored
+5
-2
@@ -21,8 +21,7 @@ type AxiosHeaderTester = (matcher?: AxiosHeaderMatcher) => boolean;
|
||||
|
||||
export class AxiosHeaders {
|
||||
constructor(
|
||||
headers?: RawAxiosHeaders | AxiosHeaders,
|
||||
defaultHeaders?: RawAxiosHeaders | AxiosHeaders
|
||||
headers?: RawAxiosHeaders | AxiosHeaders
|
||||
);
|
||||
|
||||
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||
@@ -39,12 +38,16 @@ export class AxiosHeaders {
|
||||
|
||||
normalize(format: boolean): AxiosHeaders;
|
||||
|
||||
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
||||
|
||||
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||
|
||||
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
||||
|
||||
static accessor(header: string | string[]): AxiosHeaders;
|
||||
|
||||
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
||||
|
||||
setContentType: AxiosHeaderSetter;
|
||||
getContentType: AxiosHeaderGetter;
|
||||
hasContentType: AxiosHeaderTester;
|
||||
|
||||
Reference in New Issue
Block a user