Class JsonRequest
[JsonObject]
public class JsonRequest : GenericJsonData
Inherited Members
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 SourceJsonRequest()
Create a new, empty JsonRequest
Declaration
[JsonConstructor]
public JsonRequest()
JsonRequest(GenericJsonData)
Create a new JsonRequest using a set of Json data
Declaration
public JsonRequest(GenericJsonData 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 SourceRequestKey
Key that identifies the type request being made
Declaration
protected const string RequestKey = "request"
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceRequest
The type of request being made
Declaration
[JsonIgnore]
public string Request { get; set; }
Property Value
Type | Description |
---|---|
System.String |