urllib and linksys router
Darrell Gallion
darrell at dorb.com
Sun Jul 2 02:15:30 EDT 2000
Tried to use urllib to access my linksys router, which requires a password.
After much pain, it turns out the router needs to see the request as one
string.
Maybe it's a timing thing since urllib sends each line separately.
This works.
def direct():
s = socket(AF_INET, SOCK_STREAM)
s.connect("192.168.1.1",80)
msgs=[
'GET /Status.htm HTTP/1.0\015\012',
'Authorization: Basic xxxxxxxx==\015\012',
'\015\012',
]
s.send(string.join(msgs,''))
print s.recv(1024)
print s.recv(1024)
--Darrell Gallion
More information about the Python-list
mailing list