Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: -40 #71

Open
taimojoots opened this issue Dec 2, 2021 · 0 comments
Open

OSError: -40 #71

taimojoots opened this issue Dec 2, 2021 · 0 comments

Comments

@taimojoots
Copy link

taimojoots commented Dec 2, 2021

I am trying to read json data by url on ESP8266.

from urllib.urequest import urlopen
import json
url ="https://dashboard.elering.ee/api/nps/price?start=2021-12-01T21%3A00%3A00.000Z&end=2021-12-02T20%3A00%3A00.000Z"
response = urlopen(url)
data = json.loads(response.read())
print(data) 

I get error message:

Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "/lib/urllib/urequest.py", line 30, in urlopen
OSError: -40

However the code works fine with different URL

url="http://jsonplaceholder.typicode.com/albums/1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant