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

    HTTP Get with query

    Scheduled Pinned Locked Moved UiFlow 2.0
    2 Posts 2 Posters 815 Views
    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 Offline
      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 Offline
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post