API reference
API reference
Select your platform
No SDKs available
No versions available

WitWebSocketJsonRequest Class

Web socket request that encodes a single json request

Properties

Unique request id generated on init
The client user identifier that is making the request
The specific topic id that is being published to or received via subscription, if applicable.
The specific publish options for pubsub
The timeout in milliseconds from the initial upload to the response from the server. If no response in time, the request will fail.
Whether or not uploading has begun
Whether or not downloading has begun
Whether or not complete
A task that is used to track completion of this request
A response code if applicable
An error if applicable
Initial json data to be uploaded
First decoded json response received
Callback method when raw json response is received
Callback when request receives the first chunk of data from the server
Callback when the request has completed due to a cancellation, error or success

Protected Fields

The method used to upload chunks
Start of the timeout

Member Functions

Constructor which accepts a WitResponseNode as post data and applies request id
Called once from the main thread to begin the upload process. Sends a single post chunk.
Parameters
uploadChunk
The method to be called as each json and/or binary chunk is ready to be uploaded
Cancel current request
Called one or more times from the background thread when a chunk has returned. Stores the json data from the first response.
Parameters
jsonString
Raw json string.
jsonData
Decoded json data object.
binaryData
Decoded binary data chunk which may be null or empty.
Override ToString for more request specific info

Protected Functions

Timeout if needed
Method to perform an abort call
If raw response callback is implemented, calls on main thread
Apply response data
Parameters
newResponseData
New response data received
Method called for first response handling to mark download begin and perform first response callback on main thread.
Method called on main thread when first response callback should occur
Resets the state of the request and marks request as complete.
Method called on main thread when first response callback should occur
Did you find this page helpful?
Thumbs up icon
Thumbs down icon