henri-allauch Posté(e) le 19 février 2016 Signaler Partager Posté(e) le 19 février 2016 J'ai essayé plusieurs solutions mais je ne trouve pas la bonne --[[ %% properties %% globals --]] -- executer le curl suivant OK depuis console OSX -- curl -d user_credentials= jExZZZZZZZZZZxxx -d "notification[message]=MESSAGE" -d "notification[title]=TITRE" -d "notification[sound]=50" https://api.faast.io/notifications.json local http = net.HTTPClient() local requestBody = "user_credentials=jExZZZZZZZZZZxxx¬ification[title]=TITRE¬ification[message]=MESSAGE¬ification[sound]=50" response = http:request('https://api.faast.io/notifications.json', { options={ headers = http.controlHeaders, data = requestBody, method ='POST', ---timeout =5000 }, success = function(response) fibaro:debug("Test OK" ) end, error = function(err) fibaro:debug("Test Error: " ..err) end }) http = nil Quelqu'un a une idée pour intégrer cette commande curl (qui fonctionne correctement depuis une console osx/bsd) dans une scène lua avec net.HTTPClient() Bon week end à tous dans le sud on est plus Pastis que bierre ... mais on boit aussi !!! Lien vers le commentaire Partager sur d’autres sites More sharing options...
henri-allauch Posté(e) le 21 février 2016 Auteur Signaler Partager Posté(e) le 21 février 2016 ne cherchez plus ...... j'ai trouvé une solution qui fonctionne .... au 17 eme PASTIS ... Hic Lien vers le commentaire Partager sur d’autres sites More sharing options...
henri-allauch Posté(e) le 21 février 2016 Auteur Signaler Partager Posté(e) le 21 février 2016 Mais pour ceux qui ne n'on pas bu .. on doit pouvoir faire plus propre ? --[[ %% properties %% globals --]] local Serveur = "https://api.faast.io/notifications.json" local user_credentials = "AAAABBBBCCCCDDDDEEEEFFFF" local Identifiant = "?user_credentials=" .. user_credentials local message = "MESSAGE" local title = "TITRE" local sound = "50" local Params = "¬ification[message]=" ..message .."¬ification[title]=" ..title .."¬ification[sound]=" ..sound local http = net.HTTPClient() response = http:request(Serveur ..Identifiant .. Params, { options={ method ='POST', ---timeout =5000 }, success = function(response) fibaro:debug("Test OK" ) end, error = function(err) fibaro:debug("Test Error: " ..err) end }) http = nil Lien vers le commentaire Partager sur d’autres sites More sharing options...
Messages recommandés