case class Uri(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: String = "", query: Map[String, String] = Map(), fragment: Option[Fragment] = None) extends Product with Serializable
Represents a HttpRequest URI.
You have several different options for constructing Uri:
scala> val uri1 = uri"http://google.com" uri1: hammock.Uri = Uri(Some(http),None,google.com,Map(),None) scala> val uri2 = Uri(None, None, "path", Map(), None) uri2: hammock.Uri = Uri(None,None,path,Map(),None) scala> val uri3 = Uri.fromString("http://google.com") uri3: Either[String,hammock.Uri] = Right(Uri(Some(http),None,google.com,Map(),None))
- scheme
scheme of the uri. For example https
- authority
authority of the uri. For example: user:[email protected]:443
- path
path of the uri. For example /books/234
- query
query string of the uri. For example ?page=3&utm_source=campaign
- fragment
fragment of the uri. For example #header1
- Alphabetic
- By Inheritance
- Uri
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Uri(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: String = "", query: Map[String, String] = Map(), fragment: Option[Fragment] = None)
- scheme
scheme of the uri. For example https
- authority
authority of the uri. For example: user:[email protected]:443
- path
path of the uri. For example /books/234
- query
query string of the uri. For example ?page=3&utm_source=campaign
- fragment
fragment of the uri. For example #header1
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def /(str: String): Uri
Append a string to the path of the Uri
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ?(ps: NonEmptyList[(String, String)]): Uri
Produces the same result as params but provides syntax as you are writing URI query in browser Usage example:
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val authority: Option[Authority]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val fragment: Option[Fragment]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def param(key: String, value: String): Uri
Append query parameter to query
- def params(ps: (String, String)*): Uri
Appends multiple query parameters to query
- val path: String
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val query: Map[String, String]
- val scheme: Option[Scheme]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()