Class RESTResponse
- Namespace
- Glitch9.IO.Networking.RESTApi
The base class for all API objects returned by RESTApiV3. This class encapsulates common properties and methods for handling various types of outputs from REST API responses.
public class RESTResponse : Result, IResult
- Inheritance
-
RESTResponse
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
AudioOutput
Audio data output from the API as an AudioClip object
public virtual AudioClip AudioOutput { get; set; }
Property Value
- AudioClip
BinaryOutput
Binary data output from the API
public virtual byte[] BinaryOutput { get; set; }
Property Value
- byte[]
FileOutput
File output from the API as a UnityFile object
public virtual UniFile FileOutput { get; set; }
Property Value
HasBody
Whether the API response has an empty body.
public virtual bool HasBody { get; }
Property Value
Id
The identifier, which can be referenced in API endpoints. This ID is used to uniquely identify the API object.
public virtual string Id { get; set; }
Property Value
ImageOutput
Image data output from the API as a Texture2D object
public virtual Texture2D ImageOutput { get; set; }
Property Value
- Texture2D
IsStreamDone
Returns true if it's a result of SSE event and the event is done.
public bool IsStreamDone { get; set; }
Property Value
OutputPath
The absolute path where the output file is saved
public string OutputPath { get; set; }
Property Value
StatusCode
The HTTP status code of the API response.
public long StatusCode { get; set; }
Property Value
TextOutput
Text data output from the API
public virtual string TextOutput { get; set; }
Property Value
Methods
StreamDone()
Creates a new instance of the RESTResponse class with the success flag set to true. This method is used to quickly create a successful result.
public static RESTResponse StreamDone()
Returns
- RESTResponse
A new instance of RESTResponse with IsSuccess set to true.