• http post requests

    Getting Started post urequests codesample
    16
    1 Votes
    16 Posts
    1k Views
    J
    @oglucio it would be difficult to get the same error if you applied the fix given in that post. Can you post the error and the corresponding line of your code?
  • [Solved]:FiPy socket.connect command

    FiPy fipy socket connect post
    4
    0 Votes
    4 Posts
    2k Views
    J
    Hi @dda socket.connect doesn't take a domain name, you need to resolve it first into a tuple like this - (family, type, proto, canonname, sockaddr) - which you can obtain from socket.getaddrinfo() In your case doing: s.connect(socket.getaddrinfo(addr, port)[0][-1]) should do what you want. There currently isn't a way to obtain your assigned IP address.
  • Sensor JSON Post stops after a few hours

    Expansion Board json uart post
    14
    1
    0 Votes
    14 Posts
    2k Views
    T
    @jimpower ok, so why do you get no module found when you call urequests.post now when you didn't before. I can't see all your code, just snippets. The vaious sample bits of code are being changed. Oh I see now what the problem is, when you import urequests you are importing as requests hence the module not found error. You will need to change the sample to requests.post Also as an aside why do you execfile('/flash/Wi-Fi/Wi-Fi.py') rather than importing. This seems odd thing to do.
  • Serial to UART POST JSON

    Expansion Board uart1 json post
    5
    0 Votes
    5 Posts
    1k Views
    J
    @livius I added tmp = uart1.readall() and it works thanks again I managed to do this before your reply thanks again you are always very helpful
  • urequests with ussl causes an OSError

    MicroPython urequests oserror post
    6
    1 Votes
    6 Posts
    2k Views
    D
    @this-wiederkehr You've got the point. I've tried this and finally, it works without any error. Thanks a lot.
  • 0 Votes
    1 Posts
    859 Views
    No one has replied
  • 1 Votes
    40 Posts
    23k Views
    W
    @wolli01 Hier mein Code import urequests userdata = {"p1": "Wohnzimmer", "p2": "24.12.2018", "p3": "23.97"} url = 'https://Homepage.de/live1.php' res = urequests.post(url, headers={"Content-Type": "application/json", "Accept": "application/json"}, data= str(userdata)) res.close() auf den PHP Server: <?php //Sensor1 $p1 = $_GET["p1"]; $p2 = $_GET["p2"]; $p3 = $_GET["p3"]; $inhalt = array($p1, $p2, $p3); // Speichern der Datei $eintrag = implode(";", $inhalt); file_put_contents("sensor1.txt", $eintrag); ?>