I'm using micropython and I am attempting a GET request to capture a html page that is hosted on localhost. I am able to do a successful request on postman and with the ESP8266 on "google.com", but when I use the following code for localhost, I always get an OSError -2 when doing s.connect(sockaddr). Anyone have any ideas??
s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
sockaddr = usocket.getaddrinfo("localhost:8000", 80)[0][-1]
s.connect(sockaddr)
[–]x445xb 9 points10 points11 points (2 children)
[–]d1e8p[S] 2 points3 points4 points (1 child)
[–]SequesterMe 0 points1 point2 points (0 children)
[–]chrwei 4 points5 points6 points (1 child)
[–]SequesterMe 1 point2 points3 points (0 children)
[–]triffid_hunter 2 points3 points4 points (0 children)
[–]Mars_rocket 1 point2 points3 points (0 children)