# WebStreamClient

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/WebStreamClient/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/WebStreamClient

Maintains a streaming connection.

## Properties

### ConnectionState

```luau
WebStreamClient.ConnectionState: Enum.WebStreamClientState
```

- Tags: Read only, Capabilities: Network, Save only

The current `WebStreamClientState` of the client.

## Methods

### Close

```luau
WebStreamClient:Close()
```

- Tags: Capabilities: Network

Closes the client, aborting the ongoing request.

### Send

```luau
WebStreamClient:Send(data: string)
```

- Tags: Capabilities: Network

Enqueues data to be transmitted to the server over the streaming connection.

Parameters:

- `data`: Text string to send to the server.

## Events

### Closed

```luau
WebStreamClient.Closed: RBXScriptSignal<()>
```

- Tags: Capabilities: Network

Fires when the streaming connection is closed, either by the server or by a call to [`WebStreamClient:Close()`](https://rapi.sleaze.dev/classes/WebStreamClient.md).

### Error

```luau
WebStreamClient.Error: RBXScriptSignal<(responseStatusCode: number, errorMessage: string)>
```

- Tags: Capabilities: Network

Fires if an error is received while establishing the connection or during the connection lifetime.

### MessageReceived

```luau
WebStreamClient.MessageReceived: RBXScriptSignal<(message: string)>
```

- Tags: Capabilities: Network

Fires each time a message is received from the server.

### Opened

```luau
WebStreamClient.Opened: RBXScriptSignal<(responseStatusCode: number, headers: string)>
```

- Tags: Capabilities: Network

Fires when the a connection is successfully established between the client and server, allowing for events to begin streaming.

## Inherited members

- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
