Package io.fabric8.mockwebserver.http
Class HttpUrl
- java.lang.Object
-
- io.fabric8.mockwebserver.http.HttpUrl
-
public class HttpUrl extends Object
Compatibility layer for OkHttp.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringencodedPath()Returns the entire path of this URL encoded for use in HTTP resource resolution.static HttpUrlfromUrl(URL url)static HttpUrlparse(String url)StringqueryParameter(String name)Returns the first query parameter namednamedecoded using UTF-8, or null if there is no such query parameter.StringtoString()Returns the content of this HttpUrl as a String.URIuri()Returns this URL as ajava.net.URI.
-
-
-
Constructor Detail
-
HttpUrl
public HttpUrl(URI uri)
-
-
Method Detail
-
uri
public final URI uri()
Returns this URL as ajava.net.URI.
-
encodedPath
public final String encodedPath()
Returns the entire path of this URL encoded for use in HTTP resource resolution. The returned path will start with"/".Examples URL encodedPath()http://host/"/"http://host/a/b/c"/a/b/c"http://host/a/b%20c/d"/a/b%20c/d"
-
queryParameter
public final String queryParameter(String name)
Returns the first query parameter namednamedecoded using UTF-8, or null if there is no such query parameter.Examples URL queryParameter("a")http://host/null http://host/?null http://host/?a=apple&k=key+lime"apple"http://host/?a=apple&a=apricot"apple"http://host/?a=apple&b"apple"
-
toString
public final String toString()
Returns the content of this HttpUrl as a String.
-
-