Actually, after thinking about it, I&#x27;d use a GET and I&#x27;d structure it something like<p><pre><code>     http:&#x2F;&#x2F;smartplug?state=on
     http:&#x2F;&#x2F;smartplug?state=off
</code></pre>
Then to get the state of the plug:<p><pre><code>     http:&#x2F;&#x2F;smartplug?state
</code></pre>
In jQuery this would be a easy call<p><pre><code>     $.ajax(&#x27;http:&#x2F;&#x2F;smartplug?state=on&#x27;)
</code></pre>
Of course you&#x27;d have to code the plug server to add the appropriate CORS headers but that&#x27;s true no matter how you structure the API.<p>You could either replace &#x27;smartplug&#x27; with the local ip of the device or alias it in `&#x2F;etc&#x2F;hosts`. All pretty standard stuff these days. If you wanted to expose it to the outside world (which actually should be hard to do) you would use DHCP reservation based on it&#x27;s MAC address and a DynDNS service.<p>The part that stymies me (and which no-one seems interested in addressing!) is what hardware to get.