Skip to content

OSError: -40 #71

@taimojoots

Description

@taimojoots

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions