diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/go/net%2Fhttp%2Finternal%2Findex.html | |
new repository
Diffstat (limited to 'devdocs/go/net%2Fhttp%2Finternal%2Findex.html')
| -rw-r--r-- | devdocs/go/net%2Fhttp%2Finternal%2Findex.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/devdocs/go/net%2Fhttp%2Finternal%2Findex.html b/devdocs/go/net%2Fhttp%2Finternal%2Findex.html new file mode 100644 index 00000000..9903dd5b --- /dev/null +++ b/devdocs/go/net%2Fhttp%2Finternal%2Findex.html @@ -0,0 +1,24 @@ +<h1> Package internal </h1> <ul id="short-nav"> +<li><code>import "net/http/internal"</code></li> +<li><a href="#pkg-overview" class="overviewLink">Overview</a></li> +<li><a href="#pkg-index" class="indexLink">Index</a></li> +<li><a href="#pkg-subdirectories">Subdirectories</a></li> +</ul> <h2 id="pkg-overview">Overview </h2> <p>Package internal contains HTTP internals shared by net/http and net/http/httputil. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav"> +<li><a href="#pkg-variables">Variables</a></li> +<li><a href="#NewChunkedReader">func NewChunkedReader(r io.Reader) io.Reader</a></li> +<li><a href="#NewChunkedWriter">func NewChunkedWriter(w io.Writer) io.WriteCloser</a></li> +<li><a href="#FlushAfterChunkWriter">type FlushAfterChunkWriter</a></li> +</ul> <h3>Package files</h3> <p> <span>chunked.go</span> </p> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var ErrLineTooLong = errors.New("header line too long")</pre> <h2 id="NewChunkedReader">func <span>NewChunkedReader</span> </h2> <pre data-language="go">func NewChunkedReader(r io.Reader) io.Reader</pre> <p>NewChunkedReader returns a new chunkedReader that translates the data read from r out of HTTP "chunked" format before returning it. The chunkedReader returns <span>io.EOF</span> when the final 0-length chunk is read. </p> +<p>NewChunkedReader is not needed by normal applications. The http package automatically decodes chunking when reading response bodies. </p> +<h2 id="NewChunkedWriter">func <span>NewChunkedWriter</span> </h2> <pre data-language="go">func NewChunkedWriter(w io.Writer) io.WriteCloser</pre> <p>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. </p> +<p>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. </p> +<h2 id="FlushAfterChunkWriter">type <span>FlushAfterChunkWriter</span> </h2> <p>FlushAfterChunkWriter signals from the caller of <a href="#NewChunkedWriter">NewChunkedWriter</a> that each chunk should be followed by a flush. It is used by the <span>net/http.Transport</span> 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. </p> +<pre data-language="go">type FlushAfterChunkWriter struct { + *bufio.Writer +} +</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution"> + <p class="_attribution-p"> + © Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br> + <a href="http://golang.org/pkg/net/http/internal/" class="_attribution-link">http://golang.org/pkg/net/http/internal/</a> + </p> +</div> |
