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

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Uri
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def /(str: String): Uri

    Append a string to the path of the Uri

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. 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:

    Produces the same result as params but provides syntax as you are writing URI query in browser Usage example:

    uri"example.com" ? (("a" -> "b") & ("c" -> "d") & ("e" -> "f"))
    ps

    - parameters

    returns

    updated Uri

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val authority: Option[Authority]
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. val fragment: Option[Fragment]
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def param(key: String, value: String): Uri

    Append query parameter to query

    Append query parameter to query

    key

    - parameter name

    value

    - the value

    returns

    updated Uri

  18. def params(ps: (String, String)*): Uri

    Appends multiple query parameters to query

    Appends multiple query parameters to query

    ps

    - parameters

    returns

    updated Uri

  19. val path: String
  20. def productElementNames: Iterator[String]
    Definition Classes
    Product
  21. val query: Map[String, String]
  22. val scheme: Option[Scheme]
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped