Constructor
new FetchService(options)
Creates an instance of FetchService.
Name | Type | Description |
---|---|---|
options | FetchServiceOptions | Configuration options for the fetch service. |
- Source
Methods
(async) delete(url, optionsopt) → {Promise.<Response>}
Performs a DELETE request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Additional fetch options for the DELETE request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) delete(url, optionsopt) → {Promise.<Response>}
Performs a DELETE request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Additional fetch options for the DELETE request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) get(url, optionsopt) → {Promise.<Response>}
Performs a GET request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Additional fetch options for the GET request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) get(url, optionsopt) → {Promise.<Response>}
Performs a GET request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Additional fetch options for the GET request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) post(url, body, optionsopt) → {Promise.<Response>}
Performs a POST request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
body | * | The payload to send with the POST request. | |
options | RequestInit | <optional> | Additional fetch options for the POST request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) post(url, body, optionsopt) → {Promise.<Response>}
Performs a POST request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
body | * | The payload to send with the POST request. | |
options | RequestInit | <optional> | Additional fetch options for the POST request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) put(url, body, optionsopt) → {Promise.<Response>}
Performs a PUT request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
body | * | The payload to send with the PUT request. | |
options | RequestInit | <optional> | Additional fetch options for the PUT request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) put(url, body, optionsopt) → {Promise.<Response>}
Performs a PUT request.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
body | * | The payload to send with the PUT request. | |
options | RequestInit | <optional> | Additional fetch options for the PUT request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) request(url, optionsopt) → {Promise.<Response>}
Performs a fetch request and logs the process.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Options for the fetch request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>
(async) request(url, optionsopt) → {Promise.<Response>}
Performs a fetch request and logs the process.
Name | Type | Attributes | Description |
---|---|---|---|
url | string | The URL to request. | |
options | RequestInit | <optional> | Options for the fetch request. |
- Source
A promise that resolves to the fetch response.
- Type:
- Promise.<Response>