---
source: https://iinventedlight.com/library/notes/go-net-textproto.md
title: "Go net/textproto: text request and response protocols"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Go); BSD-3-Clause (Go); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Go, net/textproto package reference; Go, net/textproto source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-net-textproto"
tags: [go, textproto, http, mime, smtp]
client: Librarian
sources:
  - id: S1
    title: "net/textproto package reference"
    publisher: Go
    url: https://pkg.go.dev/net/textproto
    accessed: 2026-11-24
    license: "BSD-3-Clause"
  - id: S2
    title: "net/textproto source"
    publisher: Go
    url: https://go.dev/src/net/textproto/textproto.go
    accessed: 2026-11-24
    license: "BSD-3-Clause"
---
# Go net/textproto: text request and response protocols
**Answer:** This package supports text request and response protocols styled like HTTP, NNTP, and SMTP.

## What it provides

RFC 9112 defines the HTTP 1.1 character set that header keys and values must follow.

Error is a numeric error response from a server.

A client can use Pipeline to manage pipelined requests and responses.

Reader can read numeric response code lines and key value headers.

It also reads whole text blocks that end with a dot on a line by itself.

## Writing and connections

Writer writes text blocks in dot-encoded form.

Conn packages Reader, Writer, and Pipeline on a single network connection.

CanonicalMIMEHeaderKey returns the canonical form of a MIME header key.

## See also

- [go-net-http-client](https://iinventedlight.com/library/notes/go-net-http-client/)
- [go-mime](https://iinventedlight.com/library/notes/go-mime/)
- [go-bufio](https://iinventedlight.com/library/notes/go-bufio/)

## Claims

- id: C1
  claim: The package supports text request and response protocols.
  source: S1
  evidence: "generic support for text-based request/response protocols"

- id: C2
  claim: The style matches HTTP, NNTP, and SMTP.
  source: S1
  evidence: "in the style of HTTP, NNTP, and SMTP"

- id: C3
  claim: Header keys and values follow the character set in RFC 9112.
  source: S2
  evidence: "RFC 9112 for header keys and values"

- id: C4
  claim: Pipeline manages pipelined requests and responses in a client.
  source: S2
  evidence: "pipelined requests and responses"

## Sources

- [S1] net/textproto package reference. Go. https://pkg.go.dev/net/textproto . License: BSD-3-Clause. Accessed 2026-11-24.

- [S2] net/textproto source. Go. https://go.dev/src/net/textproto/textproto.go . License: BSD-3-Clause. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, net/textproto package reference; Go, net/textproto source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
