URI: Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet. Such identification enables interaction with representations of the resource over a network (typically the World Wide Web) using specific protocols URL: In computing, a Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an ...
A URI has two specializations known as URL and URN. A Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it.
The java.net.URI doc itself says "every URL is a URI, abstractly speaking, but not every URI is a URL". And java.net.URL does weird stuff like checking equality of URLs by resolving host names to IP addresses (which seems at odds with RFC 3986 sec 6 in the first place, and breaks w virtual hosts).
What is the difference between a URI, a URL, and a URN?
In the classical view, a URI is a URL if it specifies the location of a resource, and a URI is a URN if it specifies the name of a resource. In the contemporary view, making this differentiation is not relevant or useful.
The term "Request-URI" is defined by the HTTP standard (RFC 2616, ยง5.1.2), and refers to the URL as it is given in the actual HTTP request. In normal HTTP requests, the URL scheme and host have already been handled by the time the request is sent (and the URL fragment does not exist at the HTTP protocol level at all), meaning the Request-URI is a path-absolute-URL string, possibly followed by ...