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 parameters:
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
Source:
Uri.scala
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

Source:
Uri.scala
def /[A : SegmentEncoder](newSegment: A): Uri

This is an alias to addSegment

This is an alias to addSegment

Source:
Uri.scala
def addSegment(newSegment: String): Uri

Urlencodes and adds a path segment to the Uri

Urlencodes and adds a path segment to the Uri

Value parameters:
newSegment

the segment to add.

Returns:

a new uri with the segment added to the path

Source:
Uri.scala
def addSegment[A : SegmentEncoder](newSegment: A): Uri

Urlencodes and adds a path segment to the Uri

Urlencodes and adds a path segment to the Uri

Type parameters:
Type

to be encoded to a Uri Segment

Value parameters:
newSegment

the segment to add.

Returns:

a new uri with the segment added to the path

Source:
Uri.scala

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=====

Query StringMap
?param=vMap("param" -> Seq("v"))
?param=Map("param" -> Seq(""))
?paramMap("param" -> Seq())
?=valueMap("" -> Seq("value"))
?p1=v1&p1=v2&p2=v3&p2=v3Map("p1" -> Seq("v1","v2"), "p2" -> Seq("v3","v4"))

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

Source:
Uri.scala

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

Source:
Uri.scala
Source:
Uri.scala
renderScheme(`s₃`) caseUri(None,Some(a),_,_,_)=> writer.<<("//").<<[Authority](`a₂`)(renderableInst[Authority]) caseUri(None,None,_,_,_)=> () } thismatch{ caseUri(_,Some(_),p,_,_)ifp.nonEmpty.&&(p.absolute.unary_!)=> writer.<<("/").<<[Path](p)(renderableInst[Path]) caseUri(None,None,p,_,_)=> if(`p₂`.absolute.unary_!.&&(`p₂`.segments.headOption.fold[Boolean](false)(((_$4:Segment)=>_$4.toString.contains(":")))))writer.<<("./").<<[Path](`p₂`)(renderableInst[Path])elsewriter.<<[Path](`p₂`)(renderableInst[Path]) caseUri(_,_,p,_,_)=> writer.<<[Path](`p₃`)(renderableInst[Path]) } if(query.nonEmpty){ writer.<<('?').<<[Query](query)(renderableInst[Query]) () }else() fragment.foreach[Writer](((f:Fragment)=>writer.<<('#').<<(Uri.encode(f,Uri.encode$default$2,spaceIsPlus=false,Uri.encode$default$4)))) writer }" class="documentableAnchor">
Definition Classes
Source:
Uri.scala
def resolve(relative: Uri): Uri
Source:
Uri.scala

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.

Source:
Uri.scala
def withFragment(fragment: Fragment): Uri
Source:
Uri.scala
def withPath(path: Path): Uri
Source:
Uri.scala

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 parameters:
path

the path string to replace

Deprecated
Source:
Uri.scala

Inherited methods

def +*?[T : QueryParamEncoder](values: Seq[T]): Self

alias for withQueryParam

alias for withQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def +*?[T : QueryParamEncoder](value: T): Self

alias for withQueryParam

alias for withQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def ++?[K : QueryParamKeyLike, T : QueryParamEncoder](param: (K, Seq[T])): Self

alias for withQueryParam

alias for withQueryParam

scala> import org.http4s.implicits._
scala> uri"www.scala.com".++?("key" -> List("value1", "value2", "value3"))
res1: Uri = www.scala.com?key=value1&key=value2&key=value3
Inherited from:
QueryOps
Source:
QueryOps.scala
def +?[K : QueryParamKeyLike](name: K): Self

alias for withQueryParam

alias for withQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def +?[K : QueryParamKeyLike, T : QueryParamEncoder](param: (K, T)): Self

alias for withQueryParam

alias for withQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def +?[T : QueryParam]: Self

alias for withQueryParam

alias for withQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def +??[T : QueryParamEncoder](value: Option[T]): Self

alias for withOptionQueryParam

alias for withOptionQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def +??[K : QueryParamKeyLike, T : QueryParamEncoder](param: (K, Option[T])): Self

alias for withOptionQueryParam

alias for withOptionQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def -?[K : QueryParamKeyLike](key: K): Self

alias for removeQueryParam

alias for removeQueryParam

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

alias for removeQueryParam

alias for removeQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
def =?[T : QueryParamEncoder](q: Map[String, List[T]]): Self

alias for setQueryParams

alias for setQueryParams

Inherited from:
QueryOps
Source:
QueryOps.scala
def ?[K : QueryParamKeyLike](name: K): Boolean

alias for containsQueryParam

alias for containsQueryParam

Inherited from:
QueryOps
Source:
QueryOps.scala
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
Source:
QueryOps.scala
Inherited from:
Product
def removeQueryParam[K : QueryParamKeyLike](key: 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
Source:
QueryOps.scala
def setQueryParams[K : QueryParamKeyLike, T : QueryParamEncoder](params: Map[K, Seq[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
Source:
QueryOps.scala
override def toString: String
Definition Classes
Renderable -> Any
Inherited from:
Renderable
Source:
Renderable.scala

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
Source:
QueryOps.scala

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
Source:
QueryOps.scala

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
Source:
QueryOps.scala
def withQueryParam[T : QueryParamEncoder, K : QueryParamKeyLike](key: K, values: Seq[T]): 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
Source:
QueryOps.scala
def withQueryParam[T : QueryParamEncoder, K : QueryParamKeyLike](key: K, value: T): 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
Source:
QueryOps.scala
def withQueryParam[K : QueryParamKeyLike](key: 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
Source:
QueryOps.scala

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
Source:
QueryOps.scala
def withQueryParams[T : QueryParamEncoder, K : QueryParamKeyLike](params: Map[K, T]): 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
Source:
QueryOps.scala

Concrete fields

lazy override val renderString: String
Source:
Uri.scala