hashicorp / go-retryablehttp

Retryable HTTP client in Go
Mozilla Public License 2.0
1.99k stars 251 forks source link

Request using retryable returns an empty body #112

Closed sebastbonilla closed 4 years ago

sebastbonilla commented 4 years ago

Hi. I've got the following request:

var reqBody []byte
req, err := http.NewRequest("GET", path, bytes.NewBuffer(reqBody))

if err != nil {
        return resp, err
    }

    req.Header.Set("Authorization", myAuth)
    req.Header.Set("Content-Type", "application/json")
    retryableReq, err := retryablehttp.FromRequest(req)
    if err != nil {
        return resp, err
    }

    resp, err = client.Do(retryableReq)

which is returning "" in the body BUT when I perform the same request using http it gets what's expected (something in the body)

yongzhang commented 3 years ago

@sebastbonilla any findings for this?