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].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 internal
    Definition Classes
    model
  • Cookie
  • CookieValueWithMeta
  • CookieWithMeta
  • HasHeaders
  • Header
  • HeaderNames
  • Headers
  • MediaType
  • MediaTypes
  • Method
  • Methods
  • Part
  • QueryParams
  • StatusCode
  • StatusCodes
  • Uri
  • UriInterpolator

case class Uri(scheme: String, userInfo: Option[UserInfo], hostSegment: Segment, port: Option[Int], pathSegments: Seq[Segment], querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment]) extends Product with Serializable

A URI. 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.

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.

Linear Supertypes
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: String, userInfo: Option[UserInfo], hostSegment: Segment, port: Option[Int], pathSegments: Seq[Segment], 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.

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def fragment: Option[String]
  8. def fragment(f: Option[String]): Uri

    Replace the fragment.

  9. def fragment(f: String): Uri

    Replace the fragment.

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

    Replace the fragment.

  11. val fragmentSegment: Option[Segment]
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def host: String
  14. def host(h: String): Uri

    Replace the host.

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

  15. def hostSegment(s: Segment): Uri

    Replace the host.

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

  16. val hostSegment: Segment
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def param(k: String, v: Option[String]): Uri

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

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

    Adds the given parameter to the query.

  23. def params: QueryParams
  24. def params(ps: (String, String)*): Uri

    Adds the given parameters to the query.

  25. def params(mqp: QueryParams): Uri

    Adds the given parameters to the query.

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

    Adds the given parameters to the query.

  27. def paramsMap: Map[String, String]
  28. def paramsSeq: Seq[(String, String)]
  29. def path: Seq[String]
  30. def path(ps: Seq[String]): Uri

    Replace path with the given path segments.

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

    Replace path with the given path segments.

  32. def path(p: String): Uri

    Replace path with the given single-segment path.

  33. def pathSegment(s: Segment): Uri

    Replace path with the given path segment.

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

    Replace path with the given path segments.

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

    Replace path with the given path segment.

  36. val pathSegments: Seq[Segment]
  37. def port(p: Option[Int]): Uri
  38. def port(p: Int): Uri
  39. val port: Option[Int]
  40. def querySegment(qf: QuerySegment): Uri

    Adds the given query segment.

  41. val querySegments: Seq[QuerySegment]
  42. def scheme(s: String): Uri

    Replace the scheme.

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

  43. val scheme: String
  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def toJavaUri: URI
  46. def toString(): String
    Definition Classes
    Uri → AnyRef → Any
  47. def userInfo(username: String, password: String): Uri
  48. def userInfo(username: String): Uri
  49. val userInfo: Option[UserInfo]
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped