I am trying to carry 3 variables by the GET method on a pbc. and it gives me this error. Can you help me? I'm going crazy
OSError: [Errno 22] EINVAL
host = "domain.com/test/test.php"
url = "domain.com/test/test.php?a=" + str(vara) + "&b=" + str(varb) + "&c=" + str(varc)
port = 80
print(url)
s = socket.socket()
s.connect((host, port))
message = "GET /200 HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n\r\n"
s.write(message.format(url))
print(s.read(256))
s.close()
OSError: [Errno 22] EINVAL
OSError: [Errno 22] EINVAL
Last edited by bdjens on Sun Dec 12, 2021 6:21 am, edited 1 time in total.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: OSError: [Errno 22] EINVAL
See the docs re socket.getaddrinfo.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: OSError: [Errno 22] EINVAL
thanks for the information
But, when I put it, it tells me that it is not declared. AF_INET
socket(AF_INET, SOCK_STREAM)
s.connect(socket.getaddrinfo(url, 80)[0][-1])
I am programming on an A9G module, so I am very limited in installing libraries.
It always gives me an error.
I'm desperate, I can't get it to work in any way ... I'm not good at this
But, when I put it, it tells me that it is not declared. AF_INET
socket(AF_INET, SOCK_STREAM)
s.connect(socket.getaddrinfo(url, 80)[0][-1])
I am programming on an A9G module, so I am very limited in installing libraries.
It always gives me an error.
I'm desperate, I can't get it to work in any way ... I'm not good at this
Re: OSError: [Errno 22] EINVAL
when the host is of the form, domain.com gives a connection error, it gives me an answer that does not exist, however, when the host is domain.com/test/test.php, for the code
what difference is there between host and url?
what difference is there between host and url?