public URI asURI() {
        try {
            return new URI(scheme.name() + "://" + domain.value() + (port == -1 ? "" : ":" + port) + path.raw() + query.raw());
        }
        catch (URISyntaxException e) {
            throw new IllegalStateException("invalid URI, this should not happen", e);
        }
    }
Returns an absolute, hierarchical URI representing this HTTP URL.
vespajlib/src/main/java/ai/vespa/http/HttpURL.java