Packages

  • package root
    Definition Classes
    root
  • package sttp
    Definition Classes
    root
  • package model

    Most model classes contain both serialisation & parsing functionality, following these conventions:

    Most model classes contain both serialisation & parsing functionality, following these conventions:

    • .toString returns a representation of the model class in a format as in an HTTP request/response. For example, for an uri this will be http://..., for a header [name]: [value], etc.
    • [SthCompanionObject].parse(serialized: String): Either[String, Sth]: returns an error message or an instance of the model class
    • [SthCompanionObject].unsafeParse(serialized: String): Sth: returns an instance of the model class or in case of an error, *throws an exception*.
    • [SthCompanionObject].unsafeApply(values): creates an instance of the model class; validates the input values and in case of an error, *throws an exception*. An error could be e.g. that the input values contain characters outside of the allowed range
    • [SthCompanionObject].safeApply(...): Either[String, Sth]: same as above, but doesn't throw exceptions. Instead, returns an error message or the model class instance
    • [SthCompanionObject].apply(...): Sth: creates the model type, without validation, and without throwing exceptions
    Definition Classes
    sttp
  • package headers
    Definition Classes
    model
  • package internal
    Definition Classes
    model
  • package sse
    Definition Classes
    model
  • ContentRangeUnits
  • ContentTypeRange
  • HasHeaders
  • Header
  • HeaderNames
  • Headers
  • MediaType
  • MediaTypes
  • Method
  • Methods
  • Part
  • QueryParams
  • RequestMetadata
  • ResponseMetadata
  • StatusCode
  • StatusCodes
  • Uri
  • UriInterpolator

case class Uri(scheme: Option[String], authority: Option[Authority], pathSegments: PathSegments, 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: PathSegments, querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment])

    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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addParam(k: String, v: Option[String]): Uri
  5. def addParam(k: String, v: String): Uri
  6. def addParams(ps: (String, String)*): Uri
  7. def addParams(mqp: QueryParams): Uri
  8. def addParams(ps: Map[String, String]): Uri
  9. def addPath(ps: Seq[String]): Uri
  10. def addPath(p: String, ps: String*): Uri
  11. def addPathSegment(s: Segment): Uri
  12. def addPathSegments(ss: Seq[Segment]): Uri
  13. def addPathSegments(s1: Segment, s2: Segment, ss: Segment*): Uri
  14. def addQuerySegment(qf: QuerySegment): Uri
  15. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  16. def authority(a: Some[Authority]): Uri

    Replace the authority.

  17. def authority(a: Authority): Uri

    Replace the authority.

  18. val authority: Option[Authority]
  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def fragment: Option[String]
  22. def fragment(f: Option[String]): Uri

    Replace the fragment.

  23. def fragment(f: String): Uri

    Replace the fragment.

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

    Replace the fragment.

  25. val fragmentSegment: Option[Segment]
  26. def fragmentSegmentEncoding(encoding: Encoding): Uri
  27. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def host: Option[String]
  29. def host(h: String): Uri

    Replace the host.

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

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

    Replace the host.

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

  31. def hostSegment(s: Segment): Uri

    Replace the host.

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

  32. def hostSegmentEncoding(encoding: Encoding): Uri
  33. def isAbsolute: Boolean
  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def isRelative: Boolean
  36. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. def params: QueryParams
  40. def paramsMap: Map[String, String]
  41. def paramsSeq: Seq[(String, String)]
  42. def path: Seq[String]
  43. val pathSegments: PathSegments
  44. def pathSegmentsEncoding(encoding: Encoding): Uri
  45. def port: Option[Int]
  46. def port(p: Option[Int]): Uri

    Replace the port.

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

  47. def port(p: Int): Uri

    Replace the port.

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

  48. val querySegments: Seq[QuerySegment]
  49. def querySegmentsEncoding(encoding: Encoding): Uri

    Replace encoding for query segments: applies to key-value, only-value and plain ones.

  50. def queryValueSegmentsEncoding(valueEncoding: Encoding): Uri

    Replace encoding for the value part of key-value query segments and for only-value ones.

  51. def resolve(other: Uri): Uri
  52. def scheme(s: Option[String]): Uri

    Replace the scheme.

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

  53. def scheme(s: String): Uri

    Replace the scheme.

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

  54. val scheme: Option[String]
  55. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  56. def toJavaUri: URI
  57. def toString(): String
    Definition Classes
    Uri → AnyRef → Any
  58. def userInfo: Option[UserInfo]
  59. def userInfo(ui: Option[UserInfo]): Uri

    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.

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

    Replace the user info with username/password combination.

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

  61. def userInfo(username: String): Uri

    Replace the user info with a username only.

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

  62. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  64. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. def withParam(k: String, v: Option[String]): Uri

    Replace query with the given single optional parameter.

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

    Replace query with the given single parameter.

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

    Replace query with the given parameters.

  68. def withParams(mqp: QueryParams): Uri

    Replace query with the given parameters.

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

    Replace query with the given parameters.

  70. def withPath(ps: Seq[String]): Uri
  71. def withPath(p: String, ps: String*): Uri
  72. def withPathSegment(s: Segment): Uri
  73. def withPathSegments(ss: Seq[Segment]): Uri
  74. def withPathSegments(s1: Segment, s2: Segment, ss: Segment*): Uri
  75. def withWholePath(p: String): Uri

    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
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated
  2. def param(k: String, v: Option[String]): Uri

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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