WebConnection (Servlet 6.0 API Documentation - Apache Tomcat 10.1.48)
Description: declaration: package: jakarta.servlet.http, interface: WebConnection

# Interface WebConnection

All Superinterfaces:
  `AutoCloseable`

public interface WebConnection extends AutoCloseable
The interface used by an `HttpUpgradeHandler` to interact with an upgraded HTTP connection.

Since:
  Servlet 3.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ServletInputStream`
  `getInputStream()`
  Provides access to the `ServletInputStream` for reading data from the client.
  `ServletOutputStream`
  `getOutputStream()`
  Provides access to the `ServletOutputStream` for writing data to the client.

  ### Methods inherited from interface AutoCloseable

  `close`

- ## Method Details

  - ### getInputStream

    ServletInputStream getInputStream() throws IOException
    Provides access to the `ServletInputStream` for reading data from the client.
    Returns:
      the input stream
    Throws:
      `IOException` - If an I/O occurs while obtaining the stream

  - ### getOutputStream

    ServletOutputStream getOutputStream() throws IOException
    Provides access to the `ServletOutputStream` for writing data to the client.
    Returns:
      the output stream
    Throws:
      `IOException` - If an I/O occurs while obtaining the stream