2023-10-28 14:55:26 +02:00
|
|
|
[bandcamp-fetch](../README.md) / Fetcher
|
|
|
|
|
|
|
|
# Class: Fetcher
|
|
|
|
|
|
|
|
## Table of contents
|
|
|
|
|
|
|
|
### Constructors
|
|
|
|
|
|
|
|
- [constructor](Fetcher.md#constructor)
|
|
|
|
|
|
|
|
### Accessors
|
|
|
|
|
|
|
|
- [cookie](Fetcher.md#cookie)
|
|
|
|
|
|
|
|
### Methods
|
|
|
|
|
|
|
|
- [fetch](Fetcher.md#fetch)
|
|
|
|
- [setCookie](Fetcher.md#setcookie)
|
|
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
### constructor
|
|
|
|
|
|
|
|
• **new Fetcher**(`params`)
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `params` | [`FetcherParams`](../interfaces/FetcherParams.md) |
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/utils/Fetcher.ts:21](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L21)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
## Accessors
|
|
|
|
|
|
|
|
### cookie
|
|
|
|
|
|
|
|
• `get` **cookie**(): `undefined` \| ``null`` \| `string`
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`undefined` \| ``null`` \| `string`
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/utils/Fetcher.ts:34](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L34)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
### fetch
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
▸ **fetch**(`url`, `jsonResponse`, `method`, `payload?`): `Promise`<`Response`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse` | ``false`` |
|
|
|
|
| `method` | [`HEAD`](../enums/FetchMethod.md#head) |
|
|
|
|
| `payload?` | `undefined` |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`Response`\>
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
|
|
|
[lib/utils/Fetcher.ts:38](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L38)
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
▸ **fetch**(`url`, `jsonResponse`, `method?`, `payload?`): `Promise`<`any`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse` | ``true`` |
|
|
|
|
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
|
|
|
|
| `payload?` | `Record`<`string`, `any`\> |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`any`\>
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/utils/Fetcher.ts:39](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L39)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
▸ **fetch**(`url`, `jsonResponse?`, `method?`, `payload?`): `Promise`<`string`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse?` | `boolean` |
|
|
|
|
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
|
|
|
|
| `payload?` | `Record`<`string`, `any`\> |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`string`\>
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/utils/Fetcher.ts:40](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L40)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
### setCookie
|
|
|
|
|
|
|
|
▸ **setCookie**(`value?`): `void`
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `value?` | ``null`` \| `string` |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`void`
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/utils/Fetcher.ts:26](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/utils/Fetcher.ts#L26)
|