Hope you all doing fine. I am new here and hopefully you might help me. Developing my first Python mobile app right now and using Kivy 2.1.0 for this. Unfortunately I am blocked in Kivy which seems to be too easy in pure Python development.
My goal: accessing the body of an URL HTTP request so that I can work with the resulting string of that body. I want to compary if the string contains "STATE=ON" or "STATE=OFF"
response of my desination URL gives back: ControlSTATE=ON (or optional STATE=OFF, depending on the current WIfi Switch status)
the solution in Python (without Kivy):
import requests
x = requests.get('URLofYourChoise)
print(x.text)
And this works (tested!)
the solution in Kivy should look sth. like this:
from kivy.network.urlrequest import UrlRequest
body = UrlRequest(' URLofYourChoise ')
print(body.text)
And this does not work :(
But what can I do with "body"? Where is the content from the HTTP response?
While watching in debug modus on my variable body, I can find the desired response in: body → _queue → 0 → 2:
I read the Kivy documentation, but honestly I think I have a lack of knowledge somewhere.
Hopefully you are able to solve my problem :) Thank you in advance!
I tried to read the Kivy URLrequest documentation in order to understand the available properties
I tried to use the Python request library → not possible as the application builder (GitHub → Repository → Actions) throws an error because of this