Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine

    This topic has been deleted. Only users with topic management privileges can see it.
    • Ralla66
      Ralla66 Most Active @haus-automatisierung last edited by

      @haus-automatisierung

      Danke für das Post Beispiel.

      1 Reply Last reply Reply Quote 0
      • Diginix
        Diginix @David G. last edited by

        @david-g Ganz schlechte Idee weil das ja auch alle Logmeldungen aller Skripte ausschaltet. Denn über warn kommt nur error und mit error logge ich nur sehr selten. Viel logischer war es die für mich nervige Logmeldung im Adapter auszukommentieren.

        haus-automatisierung 1 Reply Last reply Reply Quote 0
        • haus-automatisierung
          haus-automatisierung Developer Most Active @Diginix last edited by haus-automatisierung

          @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

          Viel logischer war es die für mich nervige Logmeldung im Adapter auszukommentieren.

          Noch logischer wäre, auf die stable Version zu gehen oder noch ein paar Stunden zu warten.
          https://github.com/ioBroker/ioBroker.javascript/commit/9f115afdfb16a54f67e2a62cc296b987bc9377b2

          0 klein0r committed to ioBroker/ioBroker.javascript
          Added option for basic auth in url (user:pass)
          Diginix 1 Reply Last reply Reply Quote 3
          • Diginix
            Diginix @haus-automatisierung last edited by

            @haus-automatisierung Hätte ich nicht schon Skripte auf http get Blöcke umgestellt, wäre ich auch einfach auf 7.8.0 zurück.
            Für mich war die minimal aufwändigste Lösung logisch und außerdem wollte ich die neuen Blöcke ja weiterhin testen und mir ansehen. Denke mal Feedback sollte dir wichtig sein. Ohne wäre der Wegfall von basic Auth ja bisher unbemerkt geblieben.
            Und wenn du nun schon eine Lösung hast, um so schöner. Danke dafür!

            1 Reply Last reply Reply Quote 0
            • haus-automatisierung
              haus-automatisierung Developer Most Active last edited by haus-automatisierung

              @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

              Denke mal Feedback sollte dir wichtig sein. Ohne wäre der Wegfall von basic Auth ja bisher unbemerkt geblieben.

              Ja, mir war nicht klar dass request RFC 7617 unterstützt (und axios nicht). War ja auch nirgendwo dokumentiert dass das gehen müsste. Ein Browser macht aus den Daten in der URL ja auch nur einen HTTP-Header. Ich hab immer nur Beispiele mit exec und curl gesehen, sobald es um Authentication ging.

              Diginix 1 Reply Last reply Reply Quote 0
              • Diginix
                Diginix @haus-automatisierung last edited by

                @haus-automatisierung Bekomme mit 7.9.3 und basic auth URLs immer noch 401 Unauthorized
                URL sieht so aus: http://user:pw@IP

                Das Passwort enthält eine spitze Klammer > als Sonderzeichen, falls das relevant ist.

                haus-automatisierung 1 Reply Last reply Reply Quote 0
                • haus-automatisierung
                  haus-automatisierung Developer Most Active @Diginix last edited by

                  @diginix Stell das Script mal auf verbose um mehr Infos im Log zu bekommen was genau gesendet wird

                  Diginix 1 Reply Last reply Reply Quote 0
                  • Diginix
                    Diginix @haus-automatisierung last edited by

                    @haus-automatisierung Wie schon vermutet ist die spitze Klammer glaube das Problem.
                    In der Logausgabe ist sie encodiert:

                    "auth":{"username":"user","password":"W4qkVKo%3E"}
                    

                    eigentlich ist es "W4qkVKo>"

                    haus-automatisierung 1 Reply Last reply Reply Quote 0
                    • haus-automatisierung
                      haus-automatisierung Developer Most Active @Diginix last edited by

                      @diginix sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                      In der Logausgabe ist sie encodiert:

                      Diese Baustelle macht mich noch fertig 🙂 7.9.4 ist auf dem Weg

                      Ralla66 1 Reply Last reply Reply Quote 1
                      • Ralla66
                        Ralla66 Most Active @haus-automatisierung last edited by

                        @haus-automatisierung

                        senden ohne Daten so ?

                        Post 1.jpg

                        haus-automatisierung 1 Reply Last reply Reply Quote 0
                        • haus-automatisierung
                          haus-automatisierung Developer Most Active @Ralla66 last edited by

                          @ralla66 Post Request ohne Daten?

                          Ralla66 1 Reply Last reply Reply Quote 0
                          • Ralla66
                            Ralla66 Most Active @haus-automatisierung last edited by

                            @haus-automatisierung

                            genau, sollte per Get und Post gehen nach Web Api OpenDTU
                            OpenDTU

                            Post_G.jpg

                            haus-automatisierung 1 Reply Last reply Reply Quote 0
                            • haus-automatisierung
                              haus-automatisierung Developer Most Active @Ralla66 last edited by

                              @ralla66 Pack mal null da rein. Also keinen Leerstring.

                              Ralla66 1 Reply Last reply Reply Quote 0
                              • Ralla66
                                Ralla66 Most Active @haus-automatisierung last edited by

                                @haus-automatisierung

                                leider nein,
                                wird der Body Leer mit gesendet ?

                                haus-automatisierung 1 Reply Last reply Reply Quote 0
                                • haus-automatisierung
                                  haus-automatisierung Developer Most Active @Ralla66 last edited by

                                  @ralla66 sagte in JavaScript 7.9.0 - Neue Objekt- und HTTP-Bausteine:

                                  leider nein,

                                  Gerade getestet, funktioniert.

                                  Screenshot 2024-03-20 at 20.09.21.png

                                  Ralla66 1 Reply Last reply Reply Quote 0
                                  • Ralla66
                                    Ralla66 Most Active @haus-automatisierung last edited by Ralla66

                                    @haus-automatisierung

                                    Post24.jpg

                                    ich schau mal morgen mit Wireshark nach

                                    haus-automatisierung 1 Reply Last reply Reply Quote 0
                                    • haus-automatisierung
                                      haus-automatisierung Developer Most Active @Ralla66 last edited by haus-automatisierung

                                      @ralla66 Du wollest einen leeren Post-Request und jetzt kommt die andere Seite damit nicht klar und möchte Werte? 🙂

                                      Was rufst Du auf? Die ntp config? Die braucht doch Werte für die Konfiguration - laut Doku:

                                      curl -u "admin:password" http://192.168.10.10/api/ntp/config -d 'data={"ntp_server":"my.own.ntp.server.home","ntp_timezone":"CET-1CEST,M3.5.0,M10.5.0/3","ntp_timezone_descr":"Europe/Berlin"}'
                                      {"type":"success","message":"Settings saved!"}
                                      

                                      Ich suche mal nicht weiter, gerne erklären wo der Fehler im JavaScript liegt mit einem funktionierenden Beispiel in curl.

                                      Ralla66 2 Replies Last reply Reply Quote 1
                                      • Ralla66
                                        Ralla66 Most Active @haus-automatisierung last edited by

                                        @haus-automatisierung

                                        Danke soweit,
                                        hatte auch die npt time getestet.
                                        Schaue mal weiter, dann kann nur die Anfrage falsch sein.

                                        1 Reply Last reply Reply Quote 0
                                        • Diginix
                                          Diginix last edited by Diginix

                                          @haus-automatisierung mit 7.9.4 funktioniert basic auth nun
                                          DANKE!

                                          1 Reply Last reply Reply Quote 1
                                          • Diginix
                                            Diginix last edited by Diginix

                                            @haus-automatisierung Bie diesem Block zum Reboot eines Sonoff mit Tasmota FW kommt eine Fehlermeldung

                                            1b67f1da-629a-40d3-94c5-9c881f6cc112-image.png

                                            09:24:16.358	info	javascript.0 (1952275) script.js.test.Test: httpGet({"method":"get","url":"http://192.168.2.77/cm?cmnd=Restart%2099&user=admin&password=gzJIi3ab","responseType":"text","responseEncoding":"utf8","timeout":2000,"headers":{"User-Agent":"Mozilla/5.0 (X11; Linux i686; rv:109.0) Gecko/20100101 Firefox/121.0"}})
                                            09:24:18.604	error	javascript.0 (1952275) script.js.test.Test: maxContentLength size of -1 exceeded
                                            
                                            haus-automatisierung 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            479
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            24
                                            148
                                            16591
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo