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

WitWebSocketJsonRequest Class

Web socket request that encodes a single json request
Meta::Voice::Net::WebSockets::Requests::WitWebSocketJsonRequest extends Meta.Voice.Net.WebSockets.IWitWebSocketRequest.

Overview

Properties

string
Unique request id generated on init
string
TopicId[Get]
The specific topic id that is being published to or received via subscription, if applicable.
bool
Whether or not uploading has begun
bool
Whether or not downloading has begun
bool
Whether or not complete
string
Code[Get]
A response code if applicable
string
Error[Get]
An error if applicable
Initial json data to be uploaded
First decoded json response 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

Public Member Functions

WitWebSocketJsonRequest
( WitResponseNode postData,
string requestId )
Constructor which accepts a WitResponseNode as post data and applies request id
void
Called once from the main thread to begin the upload process. Sends a single post chunk.
void
Cancel ( )
Cancel current request
void
HandleDownload
( WitResponseNode jsonData,
byte [] binaryData )
Called one or more times from the background thread when a chunk has returned. Stores the json data from the first response.
override string
Override ToString for more request specific info

Object Data

void
SetResponseData
( WitResponseNode newResponseData )
Apply response data
void
Method called for first response handling to mark download begin and perform first response callback on main thread.
void
Method called on main thread when first response callback should occur
void
Resets the state of the request and marks request as complete.
void
Method called on main thread when first response callback should occur

Details

Properties

string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RequestId
Unique request id generated on init
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.TopicId
The specific topic id that is being published to or received via subscription, if applicable.
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsUploading
Whether or not uploading has begun
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsDownloading
Whether or not downloading has begun
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsComplete
Whether or not complete
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Code
A response code if applicable
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Error
An error if applicable
WitResponseNode Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.PostData
Initial json data to be uploaded
WitResponseNode Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.ResponseData
First decoded json response received
Action<IWitWebSocketRequest> Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.OnFirstResponse
Callback when request receives the first chunk of data from the server
Action<IWitWebSocketRequest> Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.OnComplete
Callback when the request has completed due to a cancellation, error or success

Member Functions

Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.WitWebSocketJsonRequest
( WitResponseNode postData,
string requestId )
Constructor which accepts a WitResponseNode as post data and applies request id
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleUpload
( UploadChunkDelegate uploadChunk )
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
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Cancel ( )
Cancel current request
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleDownload
( WitResponseNode jsonData,
byte [] binaryData )
Called one or more times from the background thread when a chunk has returned. Stores the json data from the first response.
Parameters
jsonData
Decoded json data object.
binaryData
Decoded binary data chunk which may be null or empty.
override string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.ToString ( )
Override ToString for more request specific info

Object Data

virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.SetResponseData
( WitResponseNode newResponseData )
Apply response data
Parameters
newResponseData
New response data received
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleDownloadBegin ( )
Method called for first response handling to mark download begin and perform first response callback on main thread.
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RaiseFirstResponse ( )
Method called on main thread when first response callback should occur
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleComplete ( )
Resets the state of the request and marks request as complete.
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RaiseComplete ( )
Method called on main thread when first response callback should occur
Did you find this page helpful?
Thumbs up icon
Thumbs down icon