HttpPost using UIflow

  • UiFlow Example?

  • something like this:



  • My problem is before, how to get the data, i tested this but it doesn't work!
    "Get data" fail.
    0_1595873974367_Schermata 2020-07-27 alle 20.18.54.png

  • Maybe you need change POST to GET. Print get data and status code in the succes and failure part of http block. Finally try use another software to test debug requests you are send. Or read Api documentation for your service/device.I already use Restler and Pydroid3 on Android for test http connection. But i wrote code in pure python and later i create own custom block to read data from services.

    How do you get data from your first post? (this html page).

  • i use a browser and i give this Url :
    and then i get:
    ua 1 ub 1 uc 1 ud 1 ue 1 uf 1 ug 1 uh 1 ui 1 ul 1

    there are lot of python example to get this result, but i want to replay it with UiFlow
    I tested with another software using HttpPost and HttpGet, both it work the response is different.
    This Url activate small board with 8 relè with a simple web server, few commands and i can control it.
    I want to do it using UiFlow example and M5stack basic.

  • maybe you should try this code:


    also try add block to connect to your wifi and download code to device (not play button)

  • @robalstona
    Tested, and it doesn't work, no response and it doesn't send the command.

    I tested using the browser and i get the response and the hardware does what it have to do.

    0_1596266244482_Schermata 2020-08-01 alle 09.17.07.png

  • @franco try change address to: http://ip_address_of_your_wifi_router and check if yo get any tesponse. You must give back something.

    I change adress to: and i getback this response. I receive error, but show the server response for this request


  • @franco what is the m5stack device is talking to? It appears to be a web server or similar, but what is it? Also, I would recommend adding another label to the m5stack/m5stickC to get the HTTP status code. This would give an indication if the flow is timing out (no response or eventually failure after the timeout period) or what the response is with the HTTP error code (see this link for a list of error codes).

    0_1596285055868_Screen Shot 2020-08-01 at 8.30.37 AM.png

    Also, you showed two http addresses above, and I assume one is on a public network and the other is on your private/local network. So you would also need to make sure the servers are not blocking traffic from the network the m5stack/m5stickC is on.

  • @franco see the python code tab. The urequests statement comes immediately after the try statement. If something goes wrong, e.g. a typo in the address (non-existent address), this requests instruction will be treated as if it never started and the blocks Get Data and Get Status Code will not return anything and probably their use in this case cause a error.