You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeHTTPClientinterface {
Do(req*http.Request) (res*http.Response, errerror)
Get(urlstring) (res*http.Response, errerror)
Post(urstring, bodyTypestring, body io.Reader) (res*http.Response, errerror)
PostForm(urlstring, values url.Values) (res*http.Response, errerror)
Head(urlstring) (res*http.Response, errerror)
// Add any other methods here if necessary
}
This would solve #142 and more issues as it would allow for more freedom in specifying (more robust) http clients. I'm more than willing to add a PR, if this project accepts public PR's.
The text was updated successfully, but these errors were encountered:
I don't think this is a direction we want to take.
The http.RoundTripper interface already exists for defining your own transports. The *http.Client is a concrete type specifically to add helper methods (like PostForm) around an underlying HTTP transport.
To add more flexibility when it comes to HTTP clients, I propose to accept an Interface rather than a concrete type for the services.
An interface as suggested by @odeke-em in #142 (comment) and golang/go#16047
This would solve #142 and more issues as it would allow for more freedom in specifying (more robust) http clients. I'm more than willing to add a PR, if this project accepts public PR's.
The text was updated successfully, but these errors were encountered: