internal
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package internal contains HTTP internals shared by net/http andnet/http/httputil.
Index¶
Constants¶
This section is empty.
Variables¶
var ErrLineTooLong =errors.New("header line too long")
Functions¶
funcNewChunkedReader¶
NewChunkedReader returns a new chunkedReader that translates the data read from rout of HTTP "chunked" format before returning it.The chunkedReader returnsio.EOF when the final 0-length chunk is read.
NewChunkedReader is not needed by normal applications. The http packageautomatically decodes chunking when reading response bodies.
funcNewChunkedWriter¶
func NewChunkedWriter(wio.Writer)io.WriteCloser
NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP"chunked" format before writing them to w. Closing the returned chunkedWritersends the final 0-length chunk that marks the end of the stream but doesnot send the final CRLF that appears after trailers; trailers and the lastCRLF must be written separately.
NewChunkedWriter is not needed by normal applications. The httppackage adds chunking automatically if handlers don't set aContent-Length header. Using newChunkedWriter inside a handlerwould result in double chunking or chunking with a Content-Lengthlength, both of which are wrong.
Types¶
typeFlushAfterChunkWriter¶added ingo1.5
FlushAfterChunkWriter signals from the caller ofNewChunkedWriterthat each chunk should be followed by a flush. It is used by thenet/http.Transport code to keep the buffering behavior for headers andtrailers, but flush out chunks aggressively in the middle forrequest bodies which may be generated slowly. See Issue 6574.
Directories¶
Path | Synopsis |
---|---|
Package testcert contains a test-only localhost certificate. | Package testcert contains a test-only localhost certificate. |