سؤال

I have a URL that is 1029 character. I paste it into Firefox, and it loads fine. However, in Python's urllib2, I get HTTPError: HTTP Error 414: Request-URI Too Large.

response = urllib2.urlopen(csv_url)

Any reason why it works in Firefox but not in urllib2?

هل كانت مفيدة؟

المحلول

I suspect it's how the rest of the request is formatted by Firefox, vs. urllib2 -- with the resulting urllib2 packet coming in larger. Can you inspect the packet size using Firebug (a web console for Firefox -- https://getfirebug.com/).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top