在使用urequests库中的request时,显示OSError: [Errno 12] ENOMEM错误,有什么解决的办法吗?
以下为相关的代码
import network
import ubinascii
import urequests
import camera
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.scan()
wlan.isconnected()
wlan.connect("ones", "dwh424666")
wlan.config("mac")
wlan.ifconfig()
try:
camera.init(0, format=camera.JPEG)
except Exception as e:
camera.deinit()
camera.init(0, format=camera.JPEG)
buf = camera.capture()
with open("test.jpeg", "wb") as f:
f.write(buf)
print("拍照结束")
url = "https://aip.baidubce.com/rest/2.0/ocr/v ... 5-28622180"
f = open("test.jpeg", "rb")
payload = ubinascii.b2a_base64(f.read())
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
response = urequests.request("POST", url, headers = headers, data = payload, stream=True)
print(response.text)
OSError: [Errno 12] ENOMEM
-
- 随机主题
- 回复总数
- 阅读次数
- 最新文章
-
- 3回复总数
- 1423 阅读次数
- 最新文章 由 zwjiang
2020年 7月 6日 17:26
-
- 2回复总数
- 4009 阅读次数
- 最新文章 由 shaoziyang
2020年 7月 6日 21:31
-
- 4回复总数
- 1735 阅读次数
- 最新文章 由 dexter
2020年 7月 7日 09:28