@deltares/fews-web-oc-composables
@deltares/fews-web-oc-composables / useHostWebserviceContext
Function: useHostWebserviceContext()
useHostWebserviceContext():
HostWebserviceContext
Defined in: shared/hostWebserviceContext.ts:65
Beta
Retrieves the host webservice context that was previously provided via provideHostWebserviceContext.
Returns
| Member | Type | Description |
|---|---|---|
getAuthorizationHeaders | () => Promise<Headers> | Returns the headers to attach to authenticate outgoing requests. |
getBaseUrl | () => string | Returns the base URL of the FEWS webservices to use for requests. |
The host webservice context.
Throws
When no host webservice context has been provided yet.
Example
ts
import { useHostWebserviceContext } from '@deltares/fews-web-oc-composables'
const { getBaseUrl, getAuthorizationHeaders } = useHostWebserviceContext()