-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
I am running Micropython 1.20 on a ESP32-WROOM microcontroller with MiroWebSrv2 and urequests.
When MicroWebSrv2 is running (mws2.StartManaged()) I cannot use urequests to POST JSON to a FQDN domain. It will return an error of OSError(16,)
Code example below:
import urequests
def sendInfo():
data = {
"key:vaule"
}
try:
response = urequests.post(http://somedomain.com/data/api, json=data)
print("Response status code:", response.status_code)
print("Response content:", response.content)
except Exception as e:
print("Error occurred during the request:")
print(repr(e))
If I replace the FQDN domain with a IP address (random example IP below), it works as expected while MicroWebSrv2 is running. (mws2.StartManaged())
import urequests
def sendInfo():
data = {
"key:vaule"
}
try:
response = urequests.post(http://8.8.8.8/data/api, json=data)
print("Response status code:", response.status_code)
print("Response content:", response.content)
except Exception as e:
print("Error occurred during the request:")
print(repr(e))
Any suggestions on a resolution as it seems that it won't resolve DNS. (note: when I stop MicroWebSrv2 (mws2.Stop()), urequests can resolve a FQDN.)
Metadata
Metadata
Assignees
Labels
No labels