blob: 9903dd5b2dd7343106cd64a164c3e5eeb8d7571e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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>
|