Pregunta

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?

¿Fue útil?

Solución

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/).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top