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

    mcApi.http() Examples

    Developers Zone
    2
    4
    110
    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
      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

      jkandasa 1 Reply Last reply Reply Quote 0
      • jkandasa
        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
          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

          jkandasa 1 Reply Last reply Reply Quote 0
          • jkandasa
            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

            647
            Users

            505
            Topics

            3.3k
            Posts

            Copyright © 2015-2022 MyController.org | Contributors | Localization