Router
postBinary(path, file, onProgress, onLoad, onError, params)
Post a binary file object to the backend
Parameters
Param | Type | Description |
---|---|---|
path |
| Required - |
file |
| Required - File object from file input or file drop |
onProgress |
| Required - Callback function for progress event |
onLoad |
| Required - Callback function for onload event |
onError |
| Required - |
params |
| Required - |
post(path, parameters)⇒ Promise.<Response>
Promise.<Response>
Post data to specified backend endpoint
Parameters
Param | Type |
---|---|
path |
|
parameters |
|
put(path, parameters)⇒ Promise.<Response>
Promise.<Response>
Put data to specified backend endpoint
Parameters
Param | Type |
---|---|
path |
|
parameters |
|
get(path, parameters)⇒ Promise.<Response>
Promise.<Response>
Get data from specified backend endpoint
Parameters
Param | Type | Description |
---|---|---|
path |
| Required - |
parameters |
| Required - Could contain headers that will be passed along parameters.headers |
Example
head(path, parameters)⇒ Promise.<Response>
Promise.<Response>
Fetch specified backend endpoint using a http HEAD request. This is silent and will not produce any error messages.
Parameters
Param | Type | Description |
---|---|---|
path |
| Required - |
parameters |
| Required - Could contain headers that will be passed along parameters.headers |
Example
del(path, parameters)⇒ Promise.<Response>
Promise.<Response>
Make a DELETE call to a specified backend endpoint
Parameters
Param | Type | Description |
---|---|---|
path |
| Required - Backend endpoint |
parameters |
| Required - Key value request parameters |
getConceptItem(id, imType)⇒ *
*
Fetch a ConceptItem from the backend
Parameters
Param | Description |
---|---|
id | Required - The id of the concept |
imType | Required - The x-im/type |
getNewsItem(id, imType)⇒ *
*
Fetch a NewsItem from the backend
Parameters
Param | Description |
---|---|
id | Required - The id of the news item |
imType | Required - The x-im/type |
updateConceptItem(uuid, concept)⇒
Updates a Concept Item
Returns: A promise with no data
Parameters
Param | Description |
---|---|
uuid | Required - The uuid of the Concept Item to update |
concept | Required - The updated XML |
createConceptItem(concept)⇒ *
| Promise.<TResult>
*
| Promise.<TResult>
Creates a Concept Item
Returns: *
| Promise.<TResult>
- containing the resulting UUID
Parameters
Param | Description |
---|---|
concept | Required - The concept to create |
checkForOKStatus(response)⇒ *
*
Method checks for a status code between 200 and 299 Throws error if otherwise.
Use for example when you want to reject a fetch promise
Parameters
Param |
---|
response |
Example
toJson()
Deprecated
Use native response.json() instead
authorizedFetch(url, params)⇒ Promise.<*>
Promise.<*>
Parameters
Param | Type |
---|---|
url | |
params |
|