Shelly.call ("HTTP.GET" Or ("HTTP.POST"

  • Roberto Grosso 13. November 2023 um 18:27

    Hat den Titel des Themas von „Shelly.call("HTTP.GET" Or "HTTP.POST"“ zu „Shelly.call ("HTTP.GET" Or ("HTTP.POST"“ geändert.
  • Hallo Roberto,

    if you have a question solely regarding HTTP GET and POST, please provide your HTTP POST request along with the log detailing the result of the call and the exact issue.

    1. function onButtonPress_1(BTHparsed) {
    2.   if (Event254 === false) {
    3. Shelly.call("HTTP.POST",
    4.         { url: url_cmd_00 },
    5.         null,
    6.         null  
    7.       );  
    8.     }
    9. Event254 = false;
    10. cnt1++;
    11. KVSStore("Cnt_01",cnt1);
    12.     }

    the above function just do nothing
    the below work

    1. function onButtonPress_1(BTHparsed) {
    2.   if (Event254 === false) {
    3. Shelly.call("HTTP.GET",
    4.         { url: url_cmd_00 },
    5.         null,
    6.         null  
    7.       );  
    8.     }
    9. Event254 = false;
    10. cnt1++;
    11. KVSStore("Cnt_01",cnt1);
    12.     }
  • You are missing a Body in your post call:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    First of all, what is post used for? Its main use is to send/post your own data to xy.

    And what is get used for? To get data or just to call a url without sending data to it.

    There is also http. Request, which is the more advanced way to do complex http stuff.

    More infos about this:

    https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/HTTP/

    Einmal editiert, zuletzt von _[Deleted]_ (15. November 2023 um 23:38)