Need some help with loadurl result
Philippe SCHMUCK
philippe-schmuck at orange.fr
Sun Jul 29 14:11:44 EDT 2018
James,
Did you receive my off the list message?
(I’ve tested with Xtension 9.4.7 and I think it’s not completely working. According to the debug and the response I receive, the loadurl is still sending a GET and not a PUT.)
Philippe
> Le 28 juil. 2018 à 18:32, James Sentman <james at sentman.com> a écrit :
>
> Yea, thats what I was afraid of thats not going to work.
>
> But it might work with the next release that I would have had uploaded and documented already if I hadn’t stopped to add this feature to the loadURL command ;)
>
> I’ve added a “post data” parameter and if you assign your json string to it the it will send that in a POST to the device without your having to do anything else.
>
> you still have to create that json string though, just setting it like that will try to create some complicated applescript record structures or something and just cause errors. You just have to pass that as a string as the JSON format itself has no meaning to AppleScript
>
> set myJSON to “{\”on\”:{\”value\”:true}}”
>
> remembering to escape quotes that you want to be inside of an AppleScript string. and then doing something like:
>
> loadurl “http://192.168.1.141:16021/api/v1/MyToken/state” post data myJson callback handler “resultCatcher”
>
> and see what that does. Of course this is totally untested i’m not sure it will even compile properly given my choices of keywords and such. I’ve not tested that at all but it has a lot better chance of working than the other. Drop me a note off the list and let me know if that works or not. If not please do it again and add “with logging debug data” at the end. Collect the log output from that and email me off the list.
>
> I am writing the release notes for this now and will send the note to the list in an hour or so unless I catch some further psychosis and decide to add more things at literally the last second ;)
>
>
>> On Jul 28, 2018, at 11:42 AM, Philippe SCHMUCK <philippe-schmuck at orange.fr> wrote:
>>
>> loadurl "http://192.168.1.141:16021/api/v1/MyToken/state" custom request {"on" : {"value":true}} callback handler "resultCatcher"
>
> Thanks,
> James
>
>
> James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
>
>
>
>
> _______________________________________________
> XTensionList mailing list
> XTensionList at machomeautomation.com
> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
More information about the XTensionList
mailing list