package internal

Import Path
	net/http/internal (on golang.org and go.dev)

Dependency Relation
	imports 6 packages, and imported by 3 packages

Involved Source Files
	d-> chunked.go
	    testcert.go

Exported Type Names

type FlushAfterChunkWriter (struct) FlushAfterChunkWriter signals from the caller of NewChunkedWriter that each chunk should be followed by a flush. It is used by the http.Transport code to keep the buffering behavior for headers and trailers, but flush out chunks aggressively in the middle for request bodies which may be generated slowly. See Issue 6574. Writer *bufio.Writer Available returns how many bytes are unused in the buffer. Buffered returns the number of bytes that have been written into the current buffer. Flush writes any buffered data to the underlying io.Writer. ReadFrom implements io.ReaderFrom. If the underlying writer supports the ReadFrom method, and b has no buffered data yet, this calls the underlying ReadFrom without buffering. Reset discards any unflushed buffered data, clears any error, and resets b to write its output to w. Size returns the size of the underlying buffer in bytes. Write writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. WriteByte writes a single byte. WriteRune writes a single Unicode code point, returning the number of bytes written and any error. WriteString writes a string. It returns the number of bytes written. If the count is less than len(s), it also returns an error explaining why the write is short. T : io.ByteWriter T : io.ReaderFrom T : io.StringWriter T : io.Writer
Exported Values
var LocalhostCert []byte LocalhostCert is a PEM-encoded TLS cert with SAN IPs "127.0.0.1" and "[::1]", expiring at Jan 29 16:00:00 2084 GMT. generated from src/crypto/tls: go run generate_cert.go --rsa-bits 1024 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h
var LocalhostKey []byte LocalhostKey is the private key for localhostCert.
func NewChunkedReader(r io.Reader) io.Reader NewChunkedReader returns a new chunkedReader that translates the data read from r out of HTTP "chunked" format before returning it. The chunkedReader returns io.EOF when the final 0-length chunk is read. NewChunkedReader is not needed by normal applications. The http package automatically decodes chunking when reading response bodies.
func NewChunkedWriter(w io.Writer) io.WriteCloser NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP "chunked" format before writing them to w. Closing the returned chunkedWriter sends the final 0-length chunk that marks the end of the stream but does not send the final CRLF that appears after trailers; trailers and the last CRLF must be written separately. NewChunkedWriter is not needed by normal applications. The http package adds chunking automatically if handlers don't set a Content-Length header. Using newChunkedWriter inside a handler would result in double chunking or chunking with a Content-Length length, both of which are wrong.