Uri

final case class Uri(scheme: Option[Scheme], authority: Option[Authority], path: Path, query: Query, fragment: Option[Fragment]) extends QueryOps with Renderable

Representation of the Request URI

Value Params
authority

optional Uri Authority. eg, localhost:8080, www.foo.bar

fragment

optional Uri Fragment. url-encoded.

path

url-encoded string representation of the path component of the Uri.

query

optional Query. url-encoded.

scheme

optional Uri Scheme. eg, http, https

Companion
object
trait Serializable
trait Product
trait Equals
trait QueryOps
class Object
trait Matchable
class Any

Value members

Concrete methods

def /(newSegment: String): Uri

This is an alias to addSegment

This is an alias to addSegment

def addPath(morePath: String): Uri

Splits the path segments and adds each of them to the path url-encoded. A segment is delimited by /

Splits the path segments and adds each of them to the path url-encoded. A segment is delimited by /

Value Params
morePath

the path to add

Returns

a new uri with the segments added to the path

def addSegment(newSegment: String): Uri

Urlencodes and adds a path segment to the Uri

Urlencodes and adds a path segment to the Uri

Value Params
newSegment

the segment to add.

Returns

a new uri with the segment added to the path

def host: Option[Host]
def multiParams: Map[String, Seq[String]]

Representation of the query string as a map

Representation of the query string as a map

In case a parameter is available in query string but no value is there the sequence will be empty. If the value is empty the the sequence contains an empty string.

=====Examples=====

<table> <tr><th>Query String</th><th>Map</th></tr> <tr><td><code>?param=v</code></td><td><code>Map("param" -> Seq("v"))</code></td></tr> <tr><td><code>?param=</code></td><td><code>Map("param" -> Seq(""))</code></td></tr> <tr><td><code>?param</code></td><td><code>Map("param" -> Seq())</code></td></tr> <tr><td><code>?=value</code></td><td><code>Map("" -> Seq("value"))</code></td></tr> <tr><td><code>?p1=v1&amp;p1=v2&amp;p2=v3&amp;p2=v3</code></td><td><code>Map("p1" -> Seq("v1","v2"), "p2" -> Seq("v3","v4"))</code></td></tr> </table>

The query string is lazily parsed. If an error occurs during parsing an empty Map is returned.

def params: Map[String, String]

View of the head elements of the URI parameters in query string.

View of the head elements of the URI parameters in query string.

In case a parameter has no value the map returns an empty string.

See also

multiParams

def port: Option[Int]
override def render(writer: Writer): writer
Definition Classes
def resolve(relative: Uri): Uri

Converts this request to origin-form, which is the absolute path and optional query. If the path is relative, it is assumed to be relative to the root.

Converts this request to origin-form, which is the absolute path and optional query. If the path is relative, it is assumed to be relative to the root.

def userInfo: Option[UserInfo]
def withFragment(fragment: Fragment): Uri
def withPath(path: Path): Uri

Deprecated methods

@deprecated("Use {withPath(Uri.Path)} instead", "0.22.0-M1")
def withPath(path: String): Uri

Adds the path exactly as described. Any path element must be urlencoded ahead of time.

Adds the path exactly as described. Any path element must be urlencoded ahead of time.

Value Params
path

the path string to replace

Deprecated

Inherited methods

def +*?[T](values: Seq[T])(implicit evidence$6: QueryParam[T], evidence$7: QueryParamEncoder[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def +*?[T](value: T)(implicit evidence$4: QueryParamKeyLike[T], evidence$5: QueryParamEncoder[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def ++?[K, T](param: (K, Seq[T]))(implicit evidence$11: QueryParamKeyLike[K], evidence$12: QueryParamEncoder[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def +?[K](name: K)(implicit evidence$10: QueryParamKeyLike[K]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def +?[K, T](param: (K, T))(implicit evidence$8: QueryParamKeyLike[K], evidence$9: QueryParamEncoder[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def +?[T](implicit evidence$3: QueryParam[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from
QueryOps
def +??[T](value: Option[T])(implicit evidence$15: QueryParam[T], evidence$16: QueryParamEncoder[T]): Self

alias for withOptionQueryParam

alias for withOptionQueryParam

Inherited from
QueryOps
def +??[K, T](param: (K, Option[T]))(implicit evidence$13: QueryParamKeyLike[K], evidence$14: QueryParamEncoder[T]): Self

alias for withOptionQueryParam

alias for withOptionQueryParam

Inherited from
QueryOps
def -?[K](key: K)(implicit evidence$17: QueryParamKeyLike[K]): Self

alias for removeQueryParam

alias for removeQueryParam

Inherited from
QueryOps
def -?[T](implicit key: QueryParam[T]): Self

alias for removeQueryParam

alias for removeQueryParam

Inherited from
QueryOps
def =?[T](q: Map[String, List[T]])(implicit evidence$2: QueryParamEncoder[T]): Self

alias for setQueryParams

alias for setQueryParams

Inherited from
QueryOps
def ?[K](name: K)(implicit evidence$1: QueryParamKeyLike[K]): Boolean

alias for containsQueryParam

alias for containsQueryParam

Inherited from
QueryOps
def containsQueryParam[K](key: K)(implicit evidence$18: QueryParamKeyLike[K]): Boolean
Inherited from
QueryOps
def containsQueryParam[T](implicit key: QueryParam[T]): Boolean

Checks if a specified parameter exists in the Query. A parameter without a name can be checked with an empty string.

Checks if a specified parameter exists in the Query. A parameter without a name can be checked with an empty string.

Inherited from
QueryOps
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def removeQueryParam[K](key: K)(implicit evidence$19: QueryParamKeyLike[K]): Self

Creates maybe a new Self without the specified parameter in query. If no parameter with the given key exists then this will be returned.

Creates maybe a new Self without the specified parameter in query. If no parameter with the given key exists then this will be returned.

Inherited from
QueryOps
def setQueryParams[K, T](params: Map[K, Seq[T]])(implicit evidence$20: QueryParamKeyLike[K], evidence$21: QueryParamEncoder[T]): Self

Creates maybe a new Self with the specified parameters. The entire Query will be replaced with the given one.

Creates maybe a new Self with the specified parameters. The entire Query will be replaced with the given one.

Inherited from
QueryOps
override def toString: String
Definition Classes
Renderable -> Any
Inherited from
Renderable
def withMultiValueQueryParams[T, K](params: Map[K, Seq[T]])(implicit evidence$30: QueryParamEncoder[T], evidence$31: QueryParamKeyLike[K]): Self

Creates maybe a new Self with all the specified parameters in the Query. If any of the given parameters' keys already exists, the value(s) will be replaced. Parameters from the input map are added left-to-right, so if a parameter with a given key is specified more than once, it will be self-overwriting.

Creates maybe a new Self with all the specified parameters in the Query. If any of the given parameters' keys already exists, the value(s) will be replaced. Parameters from the input map are added left-to-right, so if a parameter with a given key is specified more than once, it will be self-overwriting.

Inherited from
QueryOps
def withOptionQueryParam[T](value: Option[T])(implicit evidence$34: QueryParam[T], evidence$35: QueryParamEncoder[T]): Self

Creates maybe a new Self with the specified parameter in the Query. If the value is empty or if the parameter to be added equal the existing entry the same instance of Self will be returned. If a parameter with the given name already exists the values will be replaced.

Creates maybe a new Self with the specified parameter in the Query. If the value is empty or if the parameter to be added equal the existing entry the same instance of Self will be returned. If a parameter with the given name already exists the values will be replaced.

Inherited from
QueryOps
def withOptionQueryParam[T, K](key: K, value: Option[T])(implicit evidence$32: QueryParamEncoder[T], evidence$33: QueryParamKeyLike[K]): Self

Creates maybe a new Self with the specified parameter in the Query. If the value is empty or if the parameter to be added equal the existing entry the same instance of Self will be returned. If a parameter with the given key already exists the values will be replaced.

Creates maybe a new Self with the specified parameter in the Query. If the value is empty or if the parameter to be added equal the existing entry the same instance of Self will be returned. If a parameter with the given key already exists the values will be replaced.

Inherited from
QueryOps
def withQueryParam[T, K](key: K, values: Seq[T])(implicit evidence$26: QueryParamEncoder[T], evidence$27: QueryParamKeyLike[K]): Self

Creates maybe a new Self with the specified parameters in the Query. If a parameter with the given key already exists the values will be replaced.

Creates maybe a new Self with the specified parameters in the Query. If a parameter with the given key already exists the values will be replaced.

Inherited from
QueryOps
def withQueryParam[T, K](key: K, value: T)(implicit evidence$24: QueryParamEncoder[T], evidence$25: QueryParamKeyLike[K]): Self

Creates maybe a new Self with the specified parameter in the Query. If a parameter with the given key already exists the values will be replaced. If the parameter to be added equal the existing entry the same instance of Self will be returned.

Creates maybe a new Self with the specified parameter in the Query. If a parameter with the given key already exists the values will be replaced. If the parameter to be added equal the existing entry the same instance of Self will be returned.

Inherited from
QueryOps
def withQueryParam[K](key: K)(implicit evidence$23: QueryParamKeyLike[K]): Self

Creates a new Self with the specified parameter in the Query. If a parameter with the given key already exists the values will be replaced with an empty list.

Creates a new Self with the specified parameter in the Query. If a parameter with the given key already exists the values will be replaced with an empty list.

Inherited from
QueryOps
def withQueryParam[T](implicit evidence$22: QueryParam[T]): Self

Creates a new Self with the specified parameter in the Query. If a parameter with the given QueryParam.key already exists the values will be replaced with an empty list.

Creates a new Self with the specified parameter in the Query. If a parameter with the given QueryParam.key already exists the values will be replaced with an empty list.

Inherited from
QueryOps
def withQueryParams[T, K](params: Map[K, T])(implicit evidence$28: QueryParamEncoder[T], evidence$29: QueryParamKeyLike[K]): Self

Creates maybe a new Self with all the specified parameters in the Query. If any of the given parameters' keys already exists, the value(s) will be replaced. Parameters from the input map are added left-to-right, so if a parameter with a given key is specified more than once, it will be self-overwriting.

Creates maybe a new Self with all the specified parameters in the Query. If any of the given parameters' keys already exists, the value(s) will be replaced. Parameters from the input map are added left-to-right, so if a parameter with a given key is specified more than once, it will be self-overwriting.

Inherited from
QueryOps

Concrete fields

lazy override val renderString: String