httk.core.datastream.textstream_request

Classes

TextstreamRequest

Backend for streaming text fetched via a urllib.request.Request.

Module Contents

class httk.core.datastream.textstream_request.TextstreamRequest(request, **hints)

Bases: httk.core.datastream.textstream_common.TextstreamCommon, httk.core.datastream.textstream_backend.TextstreamBackend

Backend for streaming text fetched via a urllib.request.Request. Response content is transparently decompressed before text decoding.

Parameters:
  • request (urllib.request.Request) – Request to execute lazily when text is first read.

  • **hints (Any) – Backend-selection, encoding, timeout, and compression hints.

Raises:

ValueError – If the compression hint is unknown.

property name: str | None

Report that a request backend has no filename.

property url: str

Return the request URL.

property request: urllib.request.Request

Return the request used to fetch the stream.

property closed: bool

Report whether the request backend is closed.