isomorphic-json-fetch / fetch
• post: typeof fetch
▸ delete<JsonType, ErrorType>(url
: string, config?
:
FetchConfig): Promise<{ error
: undefined |
ErrorType ; json
: undefined | JsonType ; res
: Response }>
Syntactic sugar for calling fetch(..., { method: 'DELETE', ... })
.
Name | Type | Default |
---|---|---|
JsonType |
SerializedValue | Record<string, unknown> |
ErrorType |
SerializedValue | JsonType |
Name | Type |
---|---|
url |
string |
config? |
FetchConfig |
Returns: Promise<{ error
: undefined | ErrorType ; json
: undefined
| JsonType ; res
: Response }>
Defined in: src/index.ts:161
▸ get<JsonType, ErrorType>(url
: string, config?
:
FetchConfig): Promise<{ error
: undefined |
ErrorType ; json
: undefined | JsonType ; res
: Response }>
Syntactic sugar for calling fetch(..., { method: 'GET', ... })
.
Name | Type | Default |
---|---|---|
JsonType |
SerializedValue | Record<string, unknown> |
ErrorType |
SerializedValue | JsonType |
Name | Type |
---|---|
url |
string |
config? |
FetchConfig |
Returns: Promise<{ error
: undefined | ErrorType ; json
: undefined
| JsonType ; res
: Response }>
Defined in: src/index.ts:139
▸ put<JsonType, ErrorType>(url
: string, config?
:
FetchConfig): Promise<{ error
: undefined |
ErrorType ; json
: undefined | JsonType ; res
: Response }>
Syntactic sugar for calling fetch(..., { method: 'PUT', ... })
.
Name | Type | Default |
---|---|---|
JsonType |
SerializedValue | Record<string, unknown> |
ErrorType |
SerializedValue | JsonType |
Name | Type |
---|---|
url |
string |
config? |
FetchConfig |
Returns: Promise<{ error
: undefined | ErrorType ; json
: undefined
| JsonType ; res
: Response }>
Defined in: src/index.ts:150
▸ swr(key
: string): Promise<Record<string, unknown>>
Name | Type |
---|---|
key |
string |
Returns: Promise<Record<string, unknown>>
Defined in: src/index.ts:177