🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    HTTP GET query parameters

    UIFlow
    3
    5
    6.2k
    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.
    • C
      csongor.varga
      last edited by

      Hi All,

      I want to build a weather station and use a weather API to get forecast details. I am using a service where the HTTP GET URL is the following:
      https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/Budapest/today?unitGroup=metric&elements=tempmax%2Ctempmin%2Cprecipprob%2Cconditions%2Cicon&include=days&key=API_KEY&contentType=json
      When I paste this into the HTTP request URL, the part after the ? gets truncated. I could not find an example how it needs to be added. It is not header information, nor Data.

      How to you add the query parameters?

      Thanks,
      Csongor

      E 1 Reply Last reply Reply Quote 0
      • E
        epollari @csongor.varga
        last edited by

        @csongor-varga: Yup, I'm experiencing the same issue with openweathermap.org. My HTTP GET URL gets stripped of all the parameters following the question mark. Modifying the Python code works, but there's no switching back to Blockly anymore.

        1 Reply Last reply Reply Quote 0
        • E
          epollari
          last edited by

          I've got it. Replace the existing URL text box with an unescaped text box and type/paste the URL. There should be no more truncating at the question mark.

          0_1652232311866_Screenshot 2022-05-11 042107.png

          ajb2k3A C 2 Replies Last reply Reply Quote 3
          • ajb2k3A
            ajb2k3 @epollari
            last edited by

            @epollari Nice work in sorting it out.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • C
              csongor.varga @epollari
              last edited by

              @epollari Thanks a lot. Even though I am watching my own thread, I am not getting a notification on comments. Good that I checked :)

              Can I ask you to also check my next issue?
              So my web service returns a json like this:
              {"queryCost":1,"latitude":47.4997,"longitude":19.0551,"resolvedAddress":"Budapest, MagyarorszĂĄg","address":"Budapest","timezone":"Europe/Budapest","tzoffset":2.0,"days":[{"tempmax":26.0,"tempmin":10.0,"precipprob":0.0,"conditions":"Clear","icon":"clear-day"}]}

              0_1652649195130_5efdd892-0a56-4102-9a15-ab230a2c4b8c-image.png
              So far I am just trying to get the various pieces out of this json, but you can see above how you get an element from an array. And finally it works :)

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