-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
refer: https://requests.readthedocs.io/en/latest/user/quickstart/#raw-response-content
In the rare case that you’d like to get the response Body stream (io.ReadCloser) from the server, you can access r.Raw(). If you want to do this, make sure you set stream as true in your initial request. Once you do, you can do this:
resp, err := requests.Get("http://example.com", requests.Stream(true))Implementation
add option:
type Options struct {
// ...
Stream bool
}
// Stream sets whether need streamed response from the server, you can access resp.Raw().
func Stream(yes bool) Option {
return func(opts *Options) {
opts.Stream = yes
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed