kirinlabs / HttpRequest

Simplified HTTP client, A simplie golang HTTP client library.
Apache License 2.0
176 stars 50 forks source link

Timeout bug #21

Closed happy-berry closed 5 months ago

happy-berry commented 5 months ago
        var req = HttpRequest.NewRequest().SetTimeout(time.Second * 5).SetHeaders(map[string]string{"Content-Type": "application/json"})
    req.SetTimeout(time.Second * 3)
    fmt.Println(req)
    res, err := req.Post("http://127.0.0.1:8080/mock/Send/timeout", nil)

I saw the attribute timeout unable to take effect, It only has the dafault 30s . when initiating a post request, a new request object will be created instead of using the original request object to initiate the request