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

mcApi.http() Examples

Scheduled Pinned Locked Moved Developers Zone
4 Posts 2 Posters 476 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 8 Dec 2021, 18:05

    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

    J 1 Reply Last reply 9 Dec 2021, 15:28 Reply Quote 0
    • J Offline
      jkandasa @row
      last edited by 9 Dec 2021, 15:28

      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 10 Dec 2021, 01:20 Reply Quote 0
      • R Offline
        row @jkandasa
        last edited by 10 Dec 2021, 01:20

        @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

        J 1 Reply Last reply 10 Dec 2021, 01:56 Reply Quote 0
        • J Offline
          jkandasa @row
          last edited by 10 Dec 2021, 01:56

          @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
          4 out of 4
          • First post
            4/4
            Last post

          0

          Online

          628

          Users

          532

          Topics

          3.4k

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