• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    mcApi.http() Examples

    Scheduled Pinned Locked Moved Developers Zone
    4 Posts 2 Posters 360 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      row
      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 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @row
        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 1 Reply Last reply Reply Quote 0
        • R Offline
          row @jkandasa
          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 1 Reply Last reply Reply Quote 0
          • jkandasaJ Offline
            jkandasa @row
            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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            0

            Online

            586

            Users

            529

            Topics

            3.4k

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