• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    mcApi.http() Examples

    scheduled pinned locked moved Developers Zone
    4 posts 2 posters 916 views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • R offline
      row
      global:last-edited-by,

      Hello everybody !

      I need to read from an api using mcApi.http() as a response to a button being pressed.

      The ideia is to push a button and read from the api a timeout value. This timeout will be used to keep a relay "on" for this amout of time. This api has an internal logic to calculate the timeout value and it varies depending on various parameters.

      All I need is to call this api and receive the timeout value.

      Been a newbie as I am, I am having a hard time to get this running.

      Are there examples of scripts using mcApi.http() ?

      Thank you all

      jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @row
        global:last-edited-by,

        Hi @row, welcome to MyController community 🙂
        If you are in the early stage, i would recommend to use V2.
        V1 is no longer in maintenance.

        V2 : https://v2.mycontroller.org

        But still if you are looking to use V1, let me know, I will try find out an example for you

        R one-reply-to-this-post last-reply-time reply quote 0
        • R offline
          row @jkandasa
          global:last-edited-by,

          @jkandasa HI, thank you for the replay. I am realy new to all this and I am enjoying everytihing. I am running v1.5 because I thought v2 was a pre release version.

          I have found a code sniped of mcApi.http().get in the forum and I have managed to get it running. Still no mcApi.http().post resquest thou.

          Anyways, as I am about to get everytihing up and running in v1.5, I will take a look at v2 once I finish it.

          I realy apreciate all you attention.

          RoW

          jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
          • jkandasaJ offline
            jkandasa @row
            global:last-edited-by,

            @row supported methods in http,
            https://github.com/mycontroller-org/mycontroller-v1-legacy/blob/8c540b61e56a694ec9a8c8ae21a107839091d3d0/modules/core/src/main/java/org/mycontroller/standalone/api/HttpApi.java#L31

            one-reply-to-this-post last-reply-time reply quote 0
            • first-post
              last-post

            0

            online

            644

            users

            532

            topics

            3.4k

            posts
            Copyright © 2015-2025 MyController.org | Contributors | Localization