> I have an url which redirects the client to another url. If I paste > the url into a browser, it works fine. If I open it via
Any redirection is setup using either of the 301, 302, 303, 307 return codes of HTTP. Atleast, thats what standard determines. > File "C:\Python25\lib\urllib2.py", line 575, in http_error_302 > return self.parent.open(new) Here we see that redirect handler http_error_302 has taken effect. > File "C:\Python25\lib\urllib2.py", line 499, in http_error_default > raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) > urllib2.HTTPError: HTTP Error 400: Bad Request The redirected page is not getting fetched by the OpenerDirector of urllib2. This could be due to various reasons. - the protocol is unsupported. - there is some prevention from accessing the resource directly. If its possible, can you share the url which is throwing this error? To me, it does seem urllib2 issue, it could be the (improper ??) redirection setup at webserver. > -- > http://mail.python.org/mailman/listinfo/python-list -- O.R.Senthil Kumaran http://uthcode.sarovar.org -- http://mail.python.org/mailman/listinfo/python-list