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

    HTTP Get with query

    UiFlow 2.0
    2
    2
    40
    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.
    • G
      gwky55
      last edited by

      I want to use HTTP Get to access with a query.
      For example, the following.
      http://url?val1=aaa&val2=bbb
      I can't seem to get this kind of access, even when I use the HTTP block.
      Also, it does not seem to be possible to access this way by executing requests2.get(url_with_query).
      In fact, when typing in the browser, it can be accessed correctly.
      Why is this?

      G 1 Reply Last reply Reply Quote 0
      • G
        glabasnat @gwky55
        last edited by

        @gwky55
        Hi,
        Example in MicroPython:

        ...
        def setup():
          global wlan, http_req
        
          M5.begin()
          wlan = network.WLAN(network.STA_IF)
          if wlan.isconnected():
            print('Connected')
          http_req = requests2.get('https://test/test.php?val1=aaa&val2=bbb', headers={'Content-Type': 'application/json'})
          print(http_req.status_code)
        

        And UI Flow2
        http GET.png

        AromS3
        AromS3-Lite
        CoreS3

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