Movatterモバイル変換


[0]ホーム

URL:


internal

packagestandard library
go1.25.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2025 License:BSD-3-ClauseImports:5Imported by:0

Details

Repository

cs.opensource.google/go/go

Links

Documentation

Overview

Package internal contains HTTP internals shared by net/http andnet/http/httputil.

Index

Constants

This section is empty.

Variables

View Source
var ErrLineTooLong =errors.New("header line too long")

Functions

funcNewChunkedReader

func NewChunkedReader(rio.Reader)io.Reader

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

typeFlushAfterChunkWriteradded ingo1.5

type FlushAfterChunkWriter struct {*bufio.Writer}

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.

Source Files

View all Source files

Directories

PathSynopsis
Package testcert contains a test-only localhost certificate.
Package testcert contains a test-only localhost certificate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp