• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.net.URL  RSS feed

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all genius people

I just want to know that URL class uses which version of http?
Please take me out of this question.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL class is just a way to represent/parse a URL in java. It supports the RFCs as mentioned in the javadocs.
Since, it does not make an HTTP call it is useless to specify which HTTP version it uses.
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Javadoc of neither URLConnection nor HttpURLConnection specifies which version is used. I've set up a simple server (with ServerSocket) for just reading the input, then connected using URLConnection, and the first line was "GET / HTTP/1.1". This is most likely the HTTP version used by HttpURLConnection in the current Java versions, but since it isn't specified in the Javadoc this is no requirement.

Also, please UseAMeaningfulSubjectLine next time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!