문제

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