Constructor
# new HttpClient(api, options)
Parameters:
Name | Type | Description |
---|---|---|
api |
string
|
The URL of your Hanko API instance |
options |
HttpClientOptions
|
The options the HttpClient must be provided |
Methods
# delete(path) → {Promise.<Response>}
Performs a DELETE request.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
The path to the requested resource. |
Promise.<Response>
# get(path) → {Promise.<Response>}
Performs a GET request.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
The path to the requested resource. |
Promise.<Response>
# patch(path, bodyopt) → {Promise.<Response>}
Performs a PATCH request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path to the requested resource. | |
body |
any
|
<optional> |
The request body. |
Promise.<Response>
# post(path, bodyopt) → {Promise.<Response>}
Performs a POST request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path to the requested resource. | |
body |
any
|
<optional> |
The request body. |
Promise.<Response>
# processHeaders(xhr)
Processes the response headers on login and extracts the JWT and expiration time.
Parameters:
Name | Type | Description |
---|---|---|
xhr |
XMLHttpRequest
|
The xhr object. |