net/http: clarify relationship of RoundTripper to Client #59266
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The docs for http.RoundTripper say
But Google itself publishes an OAuth RoundTripper that handles authentication via multiple requests, so I don't think this actually reflects current best practices.
The docs for http.Client say, "A Client is higher-level than a RoundTripper (such as Transport) and additionally handles HTTP details such as cookies and redirects." But it's not "such as". It just is cookies and redirects. That's all that Client adds over the RoundTripper now, and I don't think there are any plans to add anything else.
I think the documentation should be clarified to explain that a RoundTripper can do more or less whatever it wants (as long as it doesn't modify a Request or return an error for a valid response), but Client will handle the cookie jar and redirects.
I think the solution is to simplify the docs like this:
CC: @neild @bradfitz
The text was updated successfully, but these errors were encountered: