Class/Object

sttp.model

Uri

Related Docs: object Uri | package model

Permalink

case class Uri(scheme: Option[String], authority: Option[Authority], pathSegments: Seq[Segment], querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment]) extends Product with Serializable

A URI. Can represent both relative and absolute URIs, hence in terms of https://tools.ietf.org/html/rfc3986, this is a URI reference.

All components (scheme, host, query, ...) are stored decoded, and become encoded upon serialization (using toString).

Instances can be created using the uri interpolator: uri"..." (see UriInterpolator), or the factory methods on the Uri companion object.

The apply/safeApply/unsafeApply methods create absolute URIs and require a host. The relative methods creates a relative URI, given path/query/fragment components.

querySegments

Either key-value pairs, single values, or plain query segments. Key value pairs will be serialized as k=v, and blocks of key-value pairs/single values will be combined using &. Note that no & or other separators are added around plain query segments - if required, they need to be added manually as part of the plain query segment. Custom encoding logic can be provided when creating a segment.

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[String], authority: Option[Authority], pathSegments: Seq[Segment], querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment])

    Permalink

    querySegments

    Either key-value pairs, single values, or plain query segments. Key value pairs will be serialized as k=v, and blocks of key-value pairs/single values will be combined using &. Note that no & or other separators are added around plain query segments - if required, they need to be added manually as part of the plain query segment. Custom encoding logic can be provided when creating a segment.

Value Members

  1. final def !=(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addParam(k: String, v: Option[String]): Uri

    Permalink
  5. def addParam(k: String, v: String): Uri

    Permalink
  6. def addParams(ps: (String, String)*): Uri

    Permalink
  7. def addParams(mqp: QueryParams): Uri

    Permalink
  8. def addParams(ps: Map[String, String]): Uri

    Permalink
  9. def addPath(ps: Seq[String]): Uri

    Permalink
  10. def addPath(p: String, ps: String*): Uri

    Permalink
  11. def addPath(p: String): Uri

    Permalink
  12. def addPathSegment(s: Segment): Uri

    Permalink
  13. def addPathSegments(ss: Seq[Segment]): Uri

    Permalink
  14. def addPathSegments(s1: Segment, s2: Segment, ss: Segment*): Uri

    Permalink
  15. def addQuerySegment(qf: QuerySegment): Uri

    Permalink
  16. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  17. def authority(a: Some[Authority]): Uri

    Permalink

    Replace the authority.

  18. def authority(a: Authority): Uri

    Permalink

    Replace the authority.

  19. val authority: Option[Authority]

    Permalink
  20. def clone(): AnyRef

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

    Permalink
    Definition Classes
    AnyRef
  22. def fragment: Option[String]

    Permalink
  23. def fragment(f: Option[String]): Uri

    Permalink

    Replace the fragment.

  24. def fragment(f: String): Uri

    Permalink

    Replace the fragment.

  25. def fragmentSegment(s: Option[Segment]): Uri

    Permalink

    Replace the fragment.

  26. val fragmentSegment: Option[Segment]

    Permalink
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  28. def host: Option[String]

    Permalink
  29. def host(h: String): Uri

    Permalink

    Replace the host.

    Replace the host. Does not validate the new host value if it's nonempty.

  30. def hostSegment(s: Option[Segment]): Uri

    Permalink

    Replace the host.

    Replace the host. Does not validate the new host value if it's nonempty.

  31. def hostSegment(s: Segment): Uri

    Permalink

    Replace the host.

    Replace the host. Does not validate the new host value if it's nonempty.

  32. def isAbsolute: Boolean

    Permalink
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def isRelative: Boolean

    Permalink
  35. final def ne(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  37. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  38. def params: QueryParams

    Permalink
  39. def paramsMap: Map[String, String]

    Permalink
  40. def paramsSeq: Seq[(String, String)]

    Permalink
  41. def path: Seq[String]

    Permalink
  42. val pathSegments: Seq[Segment]

    Permalink
  43. def port: Option[Int]

    Permalink
  44. def port(p: Option[Int]): Uri

    Permalink

    Replace the port.

    Replace the port. Adds an empty host if one is absent, and port is defined.

  45. def port(p: Int): Uri

    Permalink

    Replace the port.

    Replace the port. Adds an empty host if one is absent.

  46. val querySegments: Seq[QuerySegment]

    Permalink

    Either key-value pairs, single values, or plain query segments.

    Either key-value pairs, single values, or plain query segments. Key value pairs will be serialized as k=v, and blocks of key-value pairs/single values will be combined using &. Note that no & or other separators are added around plain query segments - if required, they need to be added manually as part of the plain query segment. Custom encoding logic can be provided when creating a segment.

  47. def resolve(other: Uri): Uri

    Permalink
  48. def scheme(s: Option[String]): Uri

    Permalink

    Replace the scheme.

    Replace the scheme. Does not validate the new scheme value.

  49. def scheme(s: String): Uri

    Permalink

    Replace the scheme.

    Replace the scheme. Does not validate the new scheme value.

  50. val scheme: Option[String]

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

    Permalink
    Definition Classes
    AnyRef
  52. def toJavaUri: URI

    Permalink
  53. def toString(): String

    Permalink
    Definition Classes
    Uri → AnyRef → Any
  54. def userInfo: Option[UserInfo]

    Permalink
  55. def userInfo(ui: Option[UserInfo]): Uri

    Permalink

    Replace the user info with username/password combination.

    Replace the user info with username/password combination. Adds an empty host if one is absent, and user info is defined.

  56. def userInfo(username: String, password: String): Uri

    Permalink

    Replace the user info with username/password combination.

    Replace the user info with username/password combination. Adds an empty host if one is absent.

  57. def userInfo(username: String): Uri

    Permalink

    Replace the user info with a username only.

    Replace the user info with a username only. Adds an empty host if one is absent.

  58. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. def withParam(k: String, v: Option[String]): Uri

    Permalink

    Replace query with the given single optional parameter.

  62. def withParam(k: String, v: String): Uri

    Permalink

    Replace query with the given single parameter.

  63. def withParams(ps: (String, String)*): Uri

    Permalink

    Replace query with the given parameters.

  64. def withParams(mqp: QueryParams): Uri

    Permalink

    Replace query with the given parameters.

  65. def withParams(ps: Map[String, String]): Uri

    Permalink

    Replace query with the given parameters.

  66. def withPath(ps: Seq[String]): Uri

    Permalink
  67. def withPath(p: String, ps: String*): Uri

    Permalink
  68. def withPathSegment(s: Segment): Uri

    Permalink
  69. def withPathSegments(ss: Seq[Segment]): Uri

    Permalink
  70. def withPathSegments(s1: Segment, s2: Segment, ss: Segment*): Uri

    Permalink
  71. def withWholePath(p: String): Uri

    Permalink

    Replace the whole path with the given one.

    Replace the whole path with the given one. Leading / will be removed, if present, and the path will be split into segments on /.

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  2. def param(k: String, v: Option[String]): Uri

    Permalink

    Adds the given parameter with an optional value to the query if it is present.

    Adds the given parameter with an optional value to the query if it is present.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addParam or withParam

  3. def param(k: String, v: String): Uri

    Permalink

    Adds the given parameter to the query.

    Adds the given parameter to the query.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addParam or withParam

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

    Permalink

    Adds the given parameters to the query.

    Adds the given parameters to the query.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addParam or withParam

  5. def params(mqp: QueryParams): Uri

    Permalink

    Adds the given parameters to the query.

    Adds the given parameters to the query.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addParam or withParam

  6. def params(ps: Map[String, String]): Uri

    Permalink

    Adds the given parameters to the query.

    Adds the given parameters to the query.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addParam or withParam

  7. def path(ps: Seq[String]): Uri

    Permalink

    Replace path with the given path segments.

    Replace path with the given path segments.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  8. def path(p1: String, p2: String, ps: String*): Uri

    Permalink

    Replace path with the given path segments.

    Replace path with the given path segments.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  9. def path(p: String): Uri

    Permalink

    Replace path with the given single-segment path.

    Replace path with the given single-segment path.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  10. def pathSegment(s: Segment): Uri

    Permalink

    Replace path with the given path segment.

    Replace path with the given path segment.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  11. def pathSegments(ss: Seq[Segment]): Uri

    Permalink

    Replace path with the given path segments.

    Replace path with the given path segments.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  12. def pathSegments(s1: Segment, s2: Segment, ss: Segment*): Uri

    Permalink

    Replace path with the given path segment.

    Replace path with the given path segment.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addPath, withPath or withWholePath

  13. def querySegment(qf: QuerySegment): Uri

    Permalink

    Adds the given query segment.

    Adds the given query segment.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use addQuerySegment

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped