Packages

c

sttp.client4

WebSocketRequest

final case class WebSocketRequest[F[_], T](method: Method, uri: Uri, body: BasicBody, headers: Seq[Header], response: WebSocketResponseAs[F, T], options: RequestOptions, tags: Map[String, Any]) extends GenericRequest[T, WebSockets with Effect[F]] with RequestBuilder[WebSocketRequest[F, T]] with Product with Serializable

Describes an HTTP WebSocket request.

The request can be sent using an instance of WebSocketBackend with the send method.

F

The effect type used to process the WebSocket. Might include asynchronous computations (e.g. scala.concurrent.Future), pure effect descriptions (IO), or synchronous computations (Identity).

T

The target type, to which the response body should be read. If the WebSocket interactions are described entirely by the response description, this might be Unit. Otherwise, this can be a sttp.ws.WebSocket instance.

response

Description of how the WebSocket should be handled. Needs to be specified upfront so that the response is always consumed and hence there are no requirements on client code to consume it.

tags

Request-specific tags which can be used by backends for logging, metrics, etc. Empty by default.

Linear Supertypes
Serializable, Serializable, Product, Equals, GenericRequest[T, WebSockets with Effect[F]], RequestMetadata, RequestBuilder[WebSocketRequest[F, T]], PartialRequestBuilder[WebSocketRequest[F, T], WebSocketRequest[F, T]], PartialRequestExtensions[WebSocketRequest[F, T]], HasHeaders, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebSocketRequest
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. GenericRequest
  7. RequestMetadata
  8. RequestBuilder
  9. PartialRequestBuilder
  10. PartialRequestExtensions
  11. HasHeaders
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebSocketRequest(method: Method, uri: Uri, body: BasicBody, headers: Seq[Header], response: WebSocketResponseAs[F, T], options: RequestOptions, tags: Map[String, Any])

    response

    Description of how the WebSocket should be handled. Needs to be specified upfront so that the response is always consumed and hence there are no requirements on client code to consume it.

    tags

    Request-specific tags which can be used by backends for logging, metrics, etc. Empty by default.

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 acceptEncoding(encoding: String): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def auth: SpecifyAuthScheme[WebSocketRequest[F, T]]
    Definition Classes
    PartialRequestBuilder
  7. def autoDecompressionDisabled: Boolean
    Definition Classes
    PartialRequestBuilder
  8. def body(fs: Seq[(String, String)], encoding: String): WebSocketRequest[F, T]

    Encodes the given parameters as form data.

    Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded.

    If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.

    Definition Classes
    PartialRequestBuilder
  9. def body(fs: (String, String)*): WebSocketRequest[F, T]

    Encodes the given parameters as form data using utf-8.

    Encodes the given parameters as form data using utf-8. If content type is not yet specified, will be set to application/x-www-form-urlencoded.

    If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.

    Definition Classes
    PartialRequestBuilder
  10. def body(fs: Map[String, String], encoding: String): WebSocketRequest[F, T]

    Encodes the given parameters as form data.

    Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded.

    If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.

    Definition Classes
    PartialRequestBuilder
  11. def body(fs: Map[String, String]): WebSocketRequest[F, T]

    Encodes the given parameters as form data using utf-8.

    Encodes the given parameters as form data using utf-8. If content type is not yet specified, will be set to application/x-www-form-urlencoded.

    If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.

    Definition Classes
    PartialRequestBuilder
  12. def body(b: InputStream): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    Definition Classes
    PartialRequestBuilder
  13. def body(b: ByteBuffer): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    Definition Classes
    PartialRequestBuilder
  14. def body(b: Array[Byte]): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    If content length is not yet specified, will be set to the length of the given array.

    Definition Classes
    PartialRequestBuilder
  15. def body(b: String, encoding: String): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to text/plain with the given encoding.

    If content type is not yet specified, will be set to text/plain with the given encoding.

    If content length is not yet specified, will be set to the number of bytes in the string using the given encoding.

    Definition Classes
    PartialRequestBuilder
  16. def body(b: String): WebSocketRequest[F, T]

    Uses the utf-8 encoding.

    Uses the utf-8 encoding.

    If content type is not yet specified, will be set to text/plain with utf-8 encoding.

    If content length is not yet specified, will be set to the number of bytes in the string using the utf-8 encoding.

    Definition Classes
    PartialRequestBuilder
  17. def body[B](b: B)(implicit arg0: BodySerializer[B]): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    Definition Classes
    PartialRequestExtensions
  18. def body(path: Path): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    If content length is not yet specified, will be set to the length of the given file.

    Definition Classes
    PartialRequestExtensions
  19. def body(file: File): WebSocketRequest[F, T]

    If content type is not yet specified, will be set to application/octet-stream.

    If content type is not yet specified, will be set to application/octet-stream.

    If content length is noBodySerializert yet specified, will be set to the length of the given file.

    Definition Classes
    PartialRequestExtensions
  20. val body: BasicBody
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  22. def contentLength(l: Long): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  23. def contentLength: Option[Long]
    Definition Classes
    HasHeaders
  24. def contentType(ct: String, encoding: String): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  25. def contentType(mt: MediaType): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  26. def contentType(ct: String): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  27. def contentType: Option[String]
    Definition Classes
    HasHeaders
  28. def cookie(n: String, v: String): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  29. def cookie(nv: (String, String)): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  30. def cookies(nvs: (String, String)*): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  31. def cookies(cs: Iterable[CookieWithMeta]): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  32. def cookies(r: Response[_]): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  33. def cookies: Seq[Either[String, CookieWithMeta]]
    Definition Classes
    HasHeaders
  34. def copyWithBody(body: BasicBody): WebSocketRequest[F, T]
    Attributes
    protected
    Definition Classes
    WebSocketRequestPartialRequestBuilder
  35. def delete(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  36. def disableAutoDecompression: WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  37. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. def followRedirects(fr: Boolean): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  39. def get(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  40. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. def head(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  42. def header(k: String, ov: Option[String]): WebSocketRequest[F, T]

    Adds the given header to the end of the headers sequence, if the value is defined.

    Adds the given header to the end of the headers sequence, if the value is defined. Otherwise has no effect.

    Definition Classes
    PartialRequestBuilder
  43. def header(k: String, v: String): WebSocketRequest[F, T]

    Adds the given header to the end of the headers sequence.

    Adds the given header to the end of the headers sequence.

    Definition Classes
    PartialRequestBuilder
  44. def header(k: String, v: String, replaceExisting: Boolean): WebSocketRequest[F, T]

    Adds the given header to the end of the headers sequence.

    Adds the given header to the end of the headers sequence.

    replaceExisting

    If there's already a header with the same name, should it be replaced?

    Definition Classes
    PartialRequestBuilder
  45. def header(h: Header, replaceExisting: Boolean = false): WebSocketRequest[F, T]

    Adds the given header to the end of the headers sequence.

    Adds the given header to the end of the headers sequence.

    replaceExisting

    If there's already a header with the same name, should it be replaced?

    Definition Classes
    PartialRequestBuilder
  46. def header(h: String): Option[String]
    Definition Classes
    HasHeaders
  47. def headers(hs: Seq[Header], replaceExisting: Boolean): WebSocketRequest[F, T]

    Adds the given headers to the end of the headers sequence.

    Adds the given headers to the end of the headers sequence.

    Definition Classes
    PartialRequestBuilder
  48. def headers(hs: Header*): WebSocketRequest[F, T]

    Adds the given headers to the end of the headers sequence.

    Adds the given headers to the end of the headers sequence.

    Definition Classes
    PartialRequestBuilder
  49. def headers(hs: Map[String, String], replaceExisting: Boolean): WebSocketRequest[F, T]

    Adds the given headers to the end of the headers sequence.

    Adds the given headers to the end of the headers sequence.

    replaceExisting

    If there's already a header with the same name, should it be replaced?

    Definition Classes
    PartialRequestBuilder
  50. def headers(hs: Map[String, String]): WebSocketRequest[F, T]

    Adds the given headers to the end of the headers sequence.

    Adds the given headers to the end of the headers sequence.

    Definition Classes
    PartialRequestBuilder
  51. def headers(h: String): Seq[String]
    Definition Classes
    HasHeaders
  52. val headers: Seq[Header]
    Definition Classes
    WebSocketRequestPartialRequestBuilder → HasHeaders
  53. def httpVersion: Option[HttpVersion]

    GetHttpVersion from tags in request.

    GetHttpVersion from tags in request. Supported only is a few backends

    returns

    one of values form HttpVersion enum or None

    Definition Classes
    PartialRequestBuilder
  54. def httpVersion(version: HttpVersion): WebSocketRequest[F, T]

    Allows setting HTTP version per request.

    Allows setting HTTP version per request. Supported only is a few backends

    returns

    request with version tag

    Definition Classes
    PartialRequestBuilder
  55. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  56. def isWebSocket: Boolean
    Definition Classes
    GenericRequest
  57. def logSettings(logRequestBody: Option[Boolean] = None, logResponseBody: Option[Boolean] = None, logRequestHeaders: Option[Boolean] = None, logResponseHeaders: Option[Boolean] = None): WebSocketRequest[F, T]

    Will only have effect when using the LoggingBackend

    Will only have effect when using the LoggingBackend

    Definition Classes
    PartialRequestBuilder
  58. def loggingOptions: Option[LoggingOptions]
    Definition Classes
    PartialRequestBuilder
  59. def mapResponse[T2](f: (T) ⇒ T2): WebSocketRequest[F, T2]
    Definition Classes
    WebSocketRequestGenericRequest
  60. def maxRedirects(n: Int): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  61. def method(method: Method, uri: Uri): WebSocketRequest[F, T]
  62. val method: Method
    Definition Classes
    WebSocketRequest → RequestMetadata
  63. def multipartBody(p1: Part[BasicBodyPart], ps: Part[BasicBodyPart]*): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  64. def multipartBody(ps: Seq[Part[BasicBodyPart]]): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  65. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  66. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  67. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  68. def onlyMetadata: RequestMetadata

    Metadata of the request, which doesn't retain the request body, or the response handling specification.

    Metadata of the request, which doesn't retain the request body, or the response handling specification.

    Definition Classes
    GenericRequest
  69. def options(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  70. val options: RequestOptions
  71. def patch(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  72. def post(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  73. def proxyAuth: SpecifyAuthScheme[WebSocketRequest[F, T]]
    Definition Classes
    PartialRequestBuilder
  74. def put(uri: Uri): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  75. def readTimeout(t: Duration): WebSocketRequest[F, T]

    When the request is sent, if reading the response times out (there's no activity for the given period of time), a failed effect will be returned, or an exception will be thrown

    When the request is sent, if reading the response times out (there's no activity for the given period of time), a failed effect will be returned, or an exception will be thrown

    Definition Classes
    PartialRequestBuilder
  76. def redirectToGet(r: Boolean): WebSocketRequest[F, T]

    When a POST or PUT request is redirected, should the redirect be a POST/PUT as well (with the original body), or should the request be converted to a GET without a body.

    When a POST or PUT request is redirected, should the redirect be a POST/PUT as well (with the original body), or should the request be converted to a GET without a body.

    Note that this only affects 301 and 302 redirects. 303 redirects are always converted, while 307 and 308 redirects always keep the same method.

    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections for details.

    Definition Classes
    PartialRequestBuilder
  77. val response: WebSocketResponseAs[F, T]

    Description of how the response body should be handled.

    Description of how the response body should be handled. Needs to be specified upfront so that the response is always consumed and hence there are no requirements on client code to consume it.

    Definition Classes
    WebSocketRequestGenericRequestPartialRequestBuilder
  78. def send(backend: WebSocketSyncBackend)(implicit ev: =:=[Identity[T], F[T]]): Response[T]

    Sends the WebSocket request synchronously, using the given backend.

    Sends the WebSocket request synchronously, using the given backend.

    returns

    A Response, with the body handled as specified by this request (see Request.response). The response WebSocket is handled as specified by this request (see Request.response). Known exceptions are converted by backends to one of SttpClientException. Other exceptions are thrown unchanged.

  79. def send(backend: WebSocketBackend[F]): F[Response[T]]

    Sends the WebSocket request, using the given backend.

    Sends the WebSocket request, using the given backend.

    returns

    An F-effect, containing a Response, with the body handled as specified by this request (see Request.response). Effects might include asynchronous computations (e.g. scala.concurrent.Future), pure effect descriptions (IO), or error wrappers (e.g. TryBackend). Exceptions are represented as failed effects (e.g. failed futures). The response WebSocket is handled as specified by this request (see Request.response). Known exceptions are converted by backends to one of SttpClientException. Other exceptions are thrown unchanged.

  80. def show(includeBody: Boolean = true, includeHeaders: Boolean = true, sensitiveHeaders: Set[String] = HeaderNames.SensitiveHeaders): String
    Definition Classes
    PartialRequestBuilder
  81. def showBasic: String
  82. def streamBody[S](s: Streams[S])(b: BinaryStream): WebSocketStreamRequest[T, Effect[F] with S]
  83. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  84. def tag(k: String): Option[Any]
    Definition Classes
    PartialRequestBuilder
  85. def tag(k: String, v: Any): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  86. val tags: Map[String, Any]

    Request-specific tags which can be used by backends for logging, metrics, etc.

    Request-specific tags which can be used by backends for logging, metrics, etc. Empty by default.

    Definition Classes
    WebSocketRequestPartialRequestBuilder
  87. def toCurl(sensitiveHeaders: Set[String], omitAcceptEncoding: Boolean): String
    Definition Classes
    GenericRequest
  88. def toCurl(omitAcceptEncoding: Boolean): String
    Definition Classes
    GenericRequest
  89. def toCurl(sensitiveHeaders: Set[String]): String
    Definition Classes
    GenericRequest
  90. def toCurl: String
    Definition Classes
    GenericRequest
  91. def toRfc2616Format(sensitiveHeaders: Set[String]): String
    Definition Classes
    GenericRequest
  92. def toRfc2616Format: String
    Definition Classes
    GenericRequest
  93. def toString(): String
    Definition Classes
    RequestMetadata → AnyRef → Any
  94. def unsafeCookies: Seq[CookieWithMeta]
    Definition Classes
    HasHeaders
  95. val uri: Uri
    Definition Classes
    WebSocketRequest → RequestMetadata
  96. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  97. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  98. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  99. def withBody(body: BasicBody): WebSocketRequest[F, T]
    Definition Classes
    PartialRequestBuilder
  100. def withHeaders(headers: Seq[Header]): WebSocketRequest[F, T]

    Replace all headers with the given ones.

    Replace all headers with the given ones.

    Definition Classes
    WebSocketRequestPartialRequestBuilder
  101. def withOptions(options: RequestOptions): WebSocketRequest[F, T]

    Replace all options with the given ones.

    Replace all options with the given ones.

    Definition Classes
    WebSocketRequestPartialRequestBuilder
  102. def withTags(tags: Map[String, Any]): WebSocketRequest[F, T]

    Replace all tags with the given ones.

    Replace all tags with the given ones.

    Definition Classes
    WebSocketRequestPartialRequestBuilder

Deprecated Value Members

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from GenericRequest[T, WebSockets with Effect[F]]

Inherited from RequestMetadata

Inherited from RequestBuilder[WebSocketRequest[F, T]]

Inherited from HasHeaders

Inherited from AnyRef

Inherited from Any

Ungrouped