Encode request URL into a URI.