(t *testing.T)
| 1041 | } |
| 1042 | |
| 1043 | func TestRequestDisableAutoReadResponse(t *testing.T) { |
| 1044 | testWithAllTransport(t, func(t *testing.T, c *Client) { |
| 1045 | resp, err := c.R().DisableAutoReadResponse().Get("/") |
| 1046 | assertSuccess(t, resp, err) |
| 1047 | tests.AssertEqual(t, "", resp.String()) |
| 1048 | result, err := resp.ToString() |
| 1049 | tests.AssertNoError(t, err) |
| 1050 | tests.AssertEqual(t, "TestGet: text response", result) |
| 1051 | |
| 1052 | resp, err = c.R().DisableAutoReadResponse().Get("/") |
| 1053 | assertSuccess(t, resp, err) |
| 1054 | _, err = io.ReadAll(resp.Body) |
| 1055 | tests.AssertNoError(t, err) |
| 1056 | }) |
| 1057 | } |
| 1058 | |
| 1059 | func TestRestoreResponseBody(t *testing.T) { |
| 1060 | c := tc() |
nothing calls this directly
no test coverage detected
searching dependent graphs…