Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you know????  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from sun's API documentation on the URLConnection Class for the setRequestProperty() method.

How the heck do you know what values can be used for the key and value Strings?
I see this on more than just this method all over JAVA and the API never tells you what are valid entries for these keys and values. Does anyone know why Sun does this, or know where I can get information regarding such methods?
Thanks.
 
Christian Presslmayr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
look at the general javadoc documentation of class URLConnection. there's a link to http://www.ietf.org/rfc/rfc2068.txt which contains details on request properties (see chapter 5 and 14).
greetings,
chris
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll take your http://www.ietf.org/rfc/rfc2068.txt and raise you one http://www.ietf.org/rfc/rfc2616.txt
(basically just a newer revision, big whoop, eh?)
 
Zakaria Haque
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:

How the heck do you know what values can be used for the key and value Strings?

you just don't know URLConnection is an abstraction for using URL with ANY protocol. At this level of abstration there is simply no limitation on which values you can use.

Does anyone know why Sun does this,

In this case the API docs does not say anything, bacause it can not. URLConnection is way too generic to say anything about the legitimate key-value pairs.

or know where I can get information regarding such methods?

The rfcs provided in other responses are great resources for HTTP. For other schemes, you need to find necessary documentation (not necessarily the standard library docs) or just post your question here.
Hope it clarifies.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!