Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

java - Why is there a server-side limit on the length of a URL?

My Java Servlet is making use of the Facebook Graph API via the URLFetchService.fetch(HTTPRequest request) method. This had been working fine for weeks but today the length of the query I was testing was much longer than previous ones - approximately 2300 chars in length. This query resulted in a MalformedURLException : Invalid URL error being thrown.

Two hours later, I found out that the root cause was the fact that the App Engine has a hard limit on the length of a URL that is being fetched (i.e. from your GAE app to somewhere else on the web). Furthermore, this issue only manifests itself on the production server so you won't be aware of it until you've gone live.

Why is this so? I mean, with the proliferation of JSON and REST services, I can foresee many more people forming queries that will be longer than the current maximum length as they make various API calls to different services.

Question(s): Will this be 'fixed'? Is there a simple solution?

Environment Setup: Java App Engine SDK 1.6.1

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...