Namespace: service

webOS. service

Source:

Members

(static) protocol :string

Service URI protocol
Type:
  • string
Source:

(static) systemPrefix :string

System service name prefix
Type:
  • string
Source:

Methods

(static) request(uri, paramsopt) → {webOS.service~RequestObject}

Creates and sends off a service request to the system
Parameters:
Name Type Attributes Description
uri string Service URI. Accepts the normal service URI format, as well as the extended format with the service method included.
params object <optional>
Service request options.
Properties
Name Type Attributes Default Description
method string <optional>
Service method being called.
parameters object <optional>
{} JSON object of the request parameters to send.
subscribe boolean <optional>
false Whether or not a subscription is desired for this request.
resubscribe boolean <optional>
false Whether or not the request should resubscribe after a failure has occured.
onSuccess webOS.service~successCallback <optional>
Callback for a successful response.
onFailure webOS.service~failureCallback <optional>
Callback for a failed response.
onComplete webOS.service~completeCallback <optional>
Callback for when a request is complete (regardless of success or failure).
Source:
Returns:
Resulting request object. Can be used to cancel subscriptions.
Type
webOS.service~RequestObject

Type Definitions

completeCallback(response)

Parameters:
Name Type Description
response object JSON object containing the service's response data; one of either proper response data or error details.
Source:

failureCallback(error)

Parameters:
Name Type Description
error object JSON object containing the service's error details.
Source:

RequestObject

Type:
  • object
Properties:
Name Type Description
uri string Full service request URI, including method name.
params object JSON object of the request parameters to send.
subscribe boolean Whether or not a subscription is desired for this request.
resubscribe boolean Whether or not the request should resubscribe after a failure has occured.
onSuccess webOS.service~successCallback Callback for a successful response.
onFailure webOS.service~failureCallback Callback for a failed response.
onComplete webOS.service~completeCallback Callback for when a request is complete (regardless of success or failure).
send function Sends off the request. Automatically called on creation. No arguments.
cancel function Cancels the service request and any associated subscription. No arguments.
Source:

successCallback(response)

Parameters:
Name Type Description
response object JSON object containing the service's response data.
Source: