Search Results for

    Show / Hide Table of Contents

    Class JsonRequest

    • C#
    • Visual Basic
    [JsonObject]
    public class JsonRequest : GenericJsonData
    <JsonObject>
    Public Class JsonRequest
        Inherits GenericJsonData
    Inheritance
    System.Object
    GenericJsonData
    JsonRequest
    JsonResponse
    Inherited Members
    GenericJsonData.Data
    GenericJsonData.FromJson(String)
    GenericJsonData.Contains(String)
    GenericJsonData.Get(String)
    GenericJsonData.Put(String, String)
    GenericJsonData.Remove(String)
    GenericJsonData.Clear()
    GenericJsonData.ToJson()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: HomeSeer.PluginSdk.Features
    Assembly: PluginSdk.dll


    A POST request with JSON data from a web client to a feature page as a collection of key-value pairs

    Use JSON stringify to build a request in JavaScript:

    JSON.stringify({ data: {"request" : "load-page", "key" : "value"} });


    Remarks

    A default handler is provided for you in the FeaturePagePost.js page. Include that file with your plugin's feature pages and customize it as needed. A shared version will be implemented in a future release.

    Constructors

    View Source

    JsonRequest()

    Create a new, empty JsonRequest

    Declaration
    • C#
    • Visual Basic
    [JsonConstructor]
    public JsonRequest()
    <JsonConstructor>
    Public Sub New
    View Source

    JsonRequest(GenericJsonData)

    Create a new JsonRequest using a set of Json data

    Declaration
    • C#
    • Visual Basic
    public JsonRequest(GenericJsonData genericJsonData)
    Public Sub New(genericJsonData As GenericJsonData)
    Parameters
    Type Name Description
    GenericJsonData genericJsonData

    The GenericJsonData that describes the request

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when no data is provided

    System.Collections.Generic.KeyNotFoundException

    Thrown when no Request type is defined in the data

    Fields

    View Source

    RequestKey

    Key that identifies the type request being made

    Declaration
    • C#
    • Visual Basic
    protected const string RequestKey = "request"
    Protected Const RequestKey As String = "request"
    Field Value
    Type Description
    System.String

    Properties

    View Source

    Request

    The type of request being made

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    public string Request { get; set; }
    <JsonIgnore>
    Public Property Request As String
    Property Value
    Type Description
    System.String
    • View Source
    In This Article
    Back to top HomeSeer Technologies