-
-
Notifications
You must be signed in to change notification settings - Fork 772
Closed
Description
- Test codes as follow:
func TestXxx(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("null"))
}))
client := resty.New().SetRetryCount(DefaultRetryTimes).EnableGenerateCurlCmd()
x := map[string]string{}
resp, err := client.R().SetBody("{}").
SetHeader("Content-Type", "application/json; charset=utf-8").
SetForceResponseContentType("application/json").
SetAllowMethodGetPayload(true).
SetResponseBodyUnlimitedReads(true).
SetResult(x).
Get(server.URL + "/test")
fmt.Println(err)
fmt.Println(resp.String())
}- The decodeJson function will loop infinitely
