I think there are some typos in the new Agent API docs.
In http://devwiki.electricimp.com/doku.php?id=electricimpapi:agent:on you describe the agent.on()/device.send() mechanism but code examples below says device.on() and device.send().
In http://devwiki.electricimp.com/doku.php?id=electricimpapi:http:get there’s a typo (?). The table example contains a comma, but I think you either should use table syntax { Content-Type = "text/xml" } or JSON syntax { "Content-Type": "text/xml" }.
Same ting in http://devwiki.electricimp.com/doku.php?id=electricimpapi:http:jsonencode