@std/web

Overview

HTTP and URL primitives: status codes, header tables, URL parsing, query strings, and a small HTTP/1.1 client.

Every item except fetch() is pure string and table work: no I/O, no capabilities, same answer on every backend. Use them to build and inspect requests offline. fetch() opens a socket through @std/net, so a project that calls it must grant the net capability domain. WebSocket is out of scope until the network RFC lands (see requirements 12_STDLIB).

When to use it

Reach for @std/web for pure URL and header work with zero I/O: parsing hrefs, resolving relative references, manipulating query strings, or mapping status codes. fetch() and WebSocket stay out until the network RFC lands.

Capabilities

  • HttpStatus codes
  • Case-insensitive Headers
  • URL parse/resolve
  • URLSearchParams

Symbols

  • class Headers — Case-insensitive multi-value header table preserving insertion order.
  • class RequestOptions — Per-request knobs for fetch(). Pass an instance as the options
  • class Response — HTTP response holder returned by fetch().
  • class URL — WHATWG-subset URL: absolute parse plus relative resolution.
  • class URLSearchParams — Insertion-ordered query parameter table with form encoding.
  • class UrlParts — Parsed URL parts holder used by the parser and resolver.
  • enum HttpStatus
  • fn appendByte()
  • fn appendChunks()
  • fn asciiBlock()
  • fn asciiChunk()
  • fn bodyDone()
  • fn bytesToString()
  • fn chunkLineEnd()
  • fn chunkLineValue()
  • fn chunkTerminalEnd()
  • fn completePrefix()
  • fn decodeBlock()
  • fn decodeComponent()
  • fn defaultPort()
  • fn encodeComponent()
  • fn fetch()
  • fn fetchInner()
  • fn fetchOverTcp()
  • fn fetchOverTls()
  • fn findHeadersEnd()
  • fn hexDigit()
  • fn hexPair()
  • fn hexVal()
  • fn isAllDigits()
  • fn isAsciiRange()
  • fn isClientError()
  • fn isDigitCode()
  • fn isSchemeCode()
  • fn isServerError()
  • fn isSuccess()
  • fn isUnreserved()
  • fn lessThan()
  • fn lowerAscii()
  • fn mergePaths()
  • fn parseAbsolute()
  • fn parseAuthority()
  • fn parseDec()
  • fn readBodyInto()
  • fn readBodyIntoTls()
  • fn readHeaders()
  • fn readHeadersTls()
  • fn readMore()
  • fn readMoreTls()
  • fn removeDotSegments()
  • fn sliceBody()
  • fn sliceBytes()
  • fn splitFragQuery()
  • fn statusCode()
  • fn statusFromCode()
  • fn statusReason()
  • fn strBytes()