mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Refer to SetBodyStreamWriter from SetBodyStream docs
This commit is contained in:
@@ -296,7 +296,8 @@ fastttp.ListenAndServe(":80", m)
|
||||
* w.Header().Set("Set-Cookie") -> [ctx.Response.Header.SetCookie()](https://godoc.org/github.com/valyala/fasthttp#ResponseHeader.SetCookie)
|
||||
* w.Write() -> [ctx.Write()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.Write),
|
||||
[ctx.SetBody()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.SetBody),
|
||||
[ctx.SetBodyStream()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.SetBodyStream)
|
||||
[ctx.SetBodyStream()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.SetBodyStream),
|
||||
[ctx.SetBodyStreamWriter()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.SetBodyStreamWriter)
|
||||
* w.WriteHeader() -> [ctx.SetStatusCode()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.SetStatusCode)
|
||||
* w.(http.Hijacker).Hijack() -> [ctx.Hijack()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.Hijack)
|
||||
* http.Error() -> [ctx.Error()](https://godoc.org/github.com/valyala/fasthttp#RequestCtx.Error)
|
||||
|
||||
@@ -132,6 +132,8 @@ func (resp *Response) SendFile(path string) error {
|
||||
//
|
||||
// bodyStream.Close() is called after finishing reading all body data
|
||||
// if it implements io.Closer.
|
||||
//
|
||||
// See also SetBodyStreamWriter.
|
||||
func (resp *Response) SetBodyStream(bodyStream io.Reader, bodySize int) {
|
||||
resp.body = resp.body[:0]
|
||||
resp.closeBodyStream()
|
||||
|
||||
@@ -689,6 +689,8 @@ func (ctx *RequestCtx) PostBody() []byte {
|
||||
// before returning io.EOF.
|
||||
//
|
||||
// If bodySize < 0, then bodyStream is read until io.EOF.
|
||||
//
|
||||
// See also SetBodyStreamWriter.
|
||||
func (ctx *RequestCtx) SetBodyStream(bodyStream io.Reader, bodySize int) {
|
||||
ctx.Response.SetBodyStream(bodyStream, bodySize)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user