Skip to content

Cannot stream response body when debug is true in v3 #1051

@invzhi

Description

@invzhi

This bug is only for v3.

When SetDoNotParseResponse(true) with debug is true, have unexpected behavior:

Expected behavior: resty call should return immediately after the headers are received.
Actual behavior: the resty call blocks and waits until the entire response body is received before returning.

Related to original feature #87.

Maybe related to code here:

resty/client.go

Lines 2280 to 2286 in 66256ef

if req.ResponseBodyUnlimitedReads || req.Debug {
response.wrapCopyReadCloser()
if err = response.readAll(); err != nil {
return response, err
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions