UrlConnection is the more general one that can also be used for JarUrls, FileUrls, Ftp, Gopher or Mailto. I don't think any of these are valid use cases when dealing with REST apis.