Making REST Requests on Android Phone with Python
Make sure the phone is connected to the network
1. Install Termux app on your Android phone
2. Open Termux
3. Enter "apt install python"
4. Enter "y" when asked
5. After installation enter "python" to check the ver details .
6. Type "exit()"
7. Repeat same for python2 and python3
Once done
8. Enter "pip install requests" in your termux prompt to install "requests" library for python
9. Repeat commands "pip install json" and "pip install urllib3"
10. Open python using command python or python2
11. Run command :
>>import requests
r=requests.get("http://www.google.com")
print(r)
<Response [200]>
No comments:
Post a Comment