Class/Object

hammock

Uri

Related Docs: object Uri | package hammock

Permalink

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, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Uri
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Uri(scheme: Option[Scheme] = None, authority: Option[Authority] = None, path: String = "", query: Map[String, String] = Map(), fragment: Option[Fragment] = None)

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def /(str: String): Uri

    Permalink

    Append a string to the path of the Uri

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def ?(ps: NonEmptyList[(String, String)]): Uri

    Permalink

    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

    Permalink
    Definition Classes
    Any
  7. val authority: Option[Authority]

    Permalink

    authority of the uri.

    authority of the uri. For example: user:[email protected]:443

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. val fragment: Option[Fragment]

    Permalink

    fragment of the uri.

    fragment of the uri. For example #header1

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def param(key: String, value: String): Uri

    Permalink

    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

    Permalink

    Appends multiple query parameters to query

    Appends multiple query parameters to query

    ps

    - parameters

    returns

    updated Uri

  19. val path: String

    Permalink

    path of the uri.

    path of the uri. For example /books/234

  20. val query: Map[String, String]

    Permalink

    query string of the uri.

    query string of the uri. For example ?page=3&utm_source=campaign

  21. val scheme: Option[Scheme]

    Permalink

    scheme of the uri.

    scheme of the uri. For example https

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped