Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...