- Source:
Type Definitions
CssFetchRequest
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the request URL |
||||||||||||||||||||||||||||||
options |
Object | the options with which the request has been created Properties
|
||||||||||||||||||||||||||||||
execute |
Requests.CssFetchRequestExecuteFunction | call this to execute the request |
- Source:
CssFetchRequestExecuteFunction(resolveToopt, nullable, insertTargetopt, dataIdopt, nullable, mediaopt, nullable, resolveSourcedOnInsertopt, nullable) → {Basic.Deferred.<Requests.CssFetchResponse>}
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolveTo |
String |
<optional> <nullable> |
'element' | defines what the response should resolve to, may either be "element", "raw" or "sourced-element" (which is the special case to insert a link with a href instead of doing a real request) |
||||||||||||
insertTarget |
HTMLElement | Object |
<optional> |
null | defines if the retrieved value should be inserted as a dom element and if so where; if this is an element, the value gets appended into that as a style/link tag, otherwise the properties below apply Properties
|
||||||||||||
dataId |
String |
<optional> <nullable> |
null | if you need an identifier, to find inserted elements again after they are inserted into dom, you can define an id here, which will be set as the "data-id" attribute on the created node |
||||||||||||
media |
String |
<optional> <nullable> |
'all' | define the style's media attribute here to target the output device(s), could be "screen" or "print" for example |
||||||||||||
resolveSourcedOnInsert |
Boolean |
<optional> <nullable> |
false | normally sourced elements resolve on load to work with the request as far as possible, but if you want to ignore the request after insertion, you may set this parameter to "true", resulting in immediate resolution after insertion |
- Source:
- See:
Returns:
CssFetchResponse
Type:
- HTMLElement | String
- Source:
FetchRequest
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the request URL |
||||||||||||||||||||||||||||||
options |
Object | the options with which the request has been created Properties
|
||||||||||||||||||||||||||||||
execute |
Requests.FetchRequestExecuteFunction | call this to execute the request |
- Source:
FetchRequestExecuteFunction() → {Basic.Deferred.<Requests.FetchResponse>}
- Source:
Returns:
FetchResponse
Type:
- Object
Properties:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ok |
Boolean | returns true if the request received a status in the OK range (200-299) |
|||||||||||||||
status |
Number | contains the status code of the response, e.g. 404 for a not found resource, 200 for a success |
|||||||||||||||
statusText |
String | a message related to the status attribute, e.g. OK for a status 200 |
|||||||||||||||
clone |
function | will return another object with the same shape and content as response |
|||||||||||||||
text |
function | will return the response content as plain text |
|||||||||||||||
json |
function | will return the response content as JSON |
|||||||||||||||
blob |
function | will return the response content as a (binary) blob |
|||||||||||||||
headers |
Object | we do not implement a full spec-compliant Headers class, but emulate some of the functionality Properties
|
- Source:
HtmlFetchRequest
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the request URL |
||||||||||||||||||||||||||||||
options |
Object | the options with which the request has been created Properties
|
||||||||||||||||||||||||||||||
execute |
Requests.HtmlFetchRequestExecuteFunction | call this to execute the request |
- Source:
HtmlFetchRequestExecuteFunction(resolveToopt, nullable, insertTargetopt, dataIdopt, nullable, selectoropt, nullable, selectAllopt, nullable) → {Basic.Deferred.<Requests.HtmlFetchResponse>}
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolveTo |
String |
<optional> <nullable> |
'element' | defines what the response should resolve to, may either be "element" or "raw" |
||||||||||||
insertTarget |
HTMLElement | Object |
<optional> |
null | defines if the retrieved value should be inserted as a dom element and if so where; if this is an element, the value gets appended into that as (a) node(s), otherwise the properties below apply Properties
|
||||||||||||
dataId |
String |
<optional> <nullable> |
null | if you need an identifier, to find inserted elements again after they are inserted into dom, you can define an id here, which will be set as the "data-id" attribute on the created node(s) |
||||||||||||
selector |
String |
<optional> <nullable> |
null | if you'd like to preselect something from the result, you may define a regular query selector to find matching elements in the result |
||||||||||||
selectAll |
Boolean |
<optional> <nullable> |
false | usually, if a selector is defined, we select a single element, if you need to select a list, set this to true |
- Source:
- See:
Returns:
HtmlFetchResponse
Type:
- HTMLElement | Array.<HTMLElement> | String
- Source:
JsFetchRequest
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the request URL |
||||||||||||||||||||||||||||||
options |
Object | the options with which the request has been created Properties
|
||||||||||||||||||||||||||||||
execute |
Requests.JsFetchRequestExecuteFunction | call this to execute the request |
- Source:
JsFetchRequestExecuteFunction(resolveToopt, nullable, insertTargetopt, dataIdopt, nullable, resolveSourcedOnInsertopt, nullable) → {Basic.Deferred.<Requests.JsFetchResponse>}
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolveTo |
String |
<optional> <nullable> |
'element' | defines what the response should resolve to, may either be "element", "raw" or "sourced-element" (which is the special case to insert a script with a src instead of doing a real request) |
||||||||||||
insertTarget |
HTMLElement | Object |
<optional> |
null | defines if the retrieved value should be inserted as a dom element and if so where; if this is an element, the value gets appended into that as a script tag, otherwise the properties below apply Properties
|
||||||||||||
dataId |
String |
<optional> <nullable> |
null | if you need an identifier, to find inserted elements again after they are inserted into dom, you can define an id here, which will be set as the "data-id" attribute on the created node |
||||||||||||
resolveSourcedOnInsert |
Boolean |
<optional> <nullable> |
false | normally sourced elements resolve on load to work with the request as far as possible, but if you want to ignore the request after insertion, you may set this parameter to "true", resulting in immediate resolution after insertion |
- Source:
- See:
Returns:
JsFetchResponse
Type:
- HTMLElement | String
- Source:
JsonFetchRequest
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the request URL |
||||||||||||||||||||||||||||||
options |
Object | the options with which the request has been created Properties
|
||||||||||||||||||||||||||||||
execute |
Requests.JsonFetchRequestExecuteFunction | call this to execute the request |
- Source:
JsonFetchRequestExecuteFunction(resolveToopt, nullable, insertTargetopt, dataIdopt, nullable) → {Basic.Deferred.<Requests.JsonFetchResponse>}
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolveTo |
String |
<optional> <nullable> |
'object' | defines what the response should resolve to, may either be "object", "element" or "raw" |
||||||||||||
insertTarget |
HTMLElement | Object |
<optional> |
null | defines if the retrieved value should be inserted as a dom element and if so where; if this is an element, the value gets appended into that as a script tag, otherwise the properties below apply Properties
|
||||||||||||
dataId |
String |
<optional> <nullable> |
null | if you need an identifier, to find inserted elements again after they are inserted into dom, you can define an id here, which will be set as the "data-id" attribute on the created node |
- Source:
- See:
Returns:
JsonFetchResponse
Type:
- Object | HTMLElement | String
- Source:
RestfulJsonClientConfig
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
url |
URL | the current request URL, build from baseUrl and path |
options |
Object | the current options with which requests are been created, build from baseOptions and options, see createFetchRequest for details |
params |
URLSearchParams | the current URL params |
data |
Object | the current payload to be sent with requests like POST and PUT |
- Source:
- See: