Documentation ¶
Index ¶
- func ContinueReadBody(req *protocol.Request, r network.Reader, maxBodySize int, ...) error
- func ContinueReadBodyStream(req *protocol.Request, zr network.Reader, maxBodySize int, ...) error
- func GetHTTP1Request(req *protocol.Request) fmt.Stringer
- func ProxyWrite(req *protocol.Request, w network.Writer) error
- func Read(req *protocol.Request, r network.Reader, preParse ...bool) error
- func ReadBodyStream(req *protocol.Request, zr network.Reader, maxBodySize int, ...) error
- func ReadHeader(h *protocol.RequestHeader, r network.Reader) error
- func ReadHeaderAndLimitBody(req *protocol.Request, r network.Reader, maxBodySize int, preParse ...bool) error
- func ReadLimitBody(req *protocol.Request, r network.Reader, maxBodySize int, ...) error
- func Write(req *protocol.Request, w network.Writer) error
- func WriteHeader(h *protocol.RequestHeader, w network.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContinueReadBody ¶
func ContinueReadBodyStream ¶
func ContinueReadBodyStream(req *protocol.Request, zr network.Reader, maxBodySize int, preParseMultipartForm ...bool) error
ContinueReadBodyStream reads request body in stream if request header contains 'Expect: 100-continue'.
The caller must send StatusContinue response before calling this method.
If maxBodySize > 0 and the body size exceeds maxBodySize, then errBodyTooLarge is returned.
func ProxyWrite ¶
ProxyWrite is like Write but writes the request in the form expected by an HTTP proxy. In particular, ProxyWrite writes the initial Request-URI line of the request with an absolute URI, per section 5.3 of RFC 7230, including the scheme and host.
func Read ¶
Read reads request (including body) from the given r.
RemoveMultipartFormFiles or Reset must be called after reading multipart/form-data request in order to delete temporarily uploaded files.
If MayContinue returns true, the caller must:
- Either send StatusExpectationFailed response if request headers don't satisfy the caller.
- Or send StatusContinue response before reading request body with ContinueReadBody.
- Or close the connection.
io.EOF is returned if r is closed before reading the first header byte.
func ReadBodyStream ¶
func ReadHeader ¶
func ReadHeader(h *protocol.RequestHeader, r network.Reader) error
func ReadHeaderAndLimitBody ¶
func ReadHeaderAndLimitBody(req *protocol.Request, r network.Reader, maxBodySize int, preParse ...bool) error
ReadHeaderAndLimitBody reads request from the given r, limiting the body size.
If maxBodySize > 0 and the body size exceeds maxBodySize, then errBodyTooLarge is returned.
RemoveMultipartFormFiles or Reset must be called after reading multipart/form-data request in order to delete temporarily uploaded files.
If MayContinue returns true, the caller must:
- Either send StatusExpectationFailed response if request headers don't satisfy the caller.
- Or send StatusContinue response before reading request body with ContinueReadBody.
- Or close the connection.
io.EOF is returned if r is closed before reading the first header byte.
func ReadLimitBody ¶
func Write ¶
Write writes request to w.
Write doesn't flush request to w for performance reasons.
See also WriteTo.
func WriteHeader ¶
func WriteHeader(h *protocol.RequestHeader, w network.Writer) error
Write writes request header to w.
Types ¶
This section is empty.