tutorials:htmlaccess
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorials:htmlaccess [2017/12/12 14:29] – created James Sentman | tutorials:htmlaccess [2023/02/13 14:52] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
In spite of it’s name the “JSON” server doesn’t actually require any JSON to be a part of the connection. Our first use for it was receiving JSON requests from a specific device and the name stuck. It will happily handle normal web requests and form variables that have nothing to do with JSON at all. | In spite of it’s name the “JSON” server doesn’t actually require any JSON to be a part of the connection. Our first use for it was receiving JSON requests from a specific device and the name stuck. It will happily handle normal web requests and form variables that have nothing to do with JSON at all. | ||
- | First create an accessor | + | First create an accessor |
In the ON script use the “Insert” toolbar button to add the “JSONRequest” handler. The form of the handler in AppleScript is like this: | In the ON script use the “Insert” toolbar button to add the “JSONRequest” handler. The form of the handler in AppleScript is like this: | ||
Line 123: | Line 123: | ||
</ | </ | ||
- | The [[dictionary: | + | The [[dictionary: |
If control is requested for a unit not in that list a “403: Forbidden” error will be returned to the browser or other device. | If control is requested for a unit not in that list a “403: Forbidden” error will be returned to the browser or other device. | ||
Line 141: | Line 141: | ||
-- 2 or 3 form variables are required for this to work. | -- 2 or 3 form variables are required for this to work. | ||
- | -- name=the unit name (which must be properly URL escaped so really “the%20unit%20name%20”) | + | -- name=the unit name (which must be properly URL escaped so really “the%20unit%20name”) |
-- command=on (can be on, off or setvalue) | -- command=on (can be on, off or setvalue) | ||
-- if the command is setvalue then a value must also be specified | -- if the command is setvalue then a value must also be specified |
tutorials/htmlaccess.1513088982.txt.gz · Last modified: 2023/02/13 14:51 (external edit)