RoundTrip implements the RoundTripper interface.
(req *http.Request)
| 1937 | |
| 1938 | // RoundTrip implements the RoundTripper interface. |
| 1939 | func (t *UnauthenticatedRateLimitedTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
| 1940 | if t.ClientID == "" { |
| 1941 | return nil, errors.New("t.ClientID is empty") |
| 1942 | } |
| 1943 | if t.ClientSecret == "" { |
| 1944 | return nil, errors.New("t.ClientSecret is empty") |
| 1945 | } |
| 1946 | |
| 1947 | req2 := setCredentialsAsHeaders(req, t.ClientID, t.ClientSecret) |
| 1948 | // Make the HTTP request. |
| 1949 | return t.transport().RoundTrip(req2) |
| 1950 | } |
| 1951 | |
| 1952 | // Client returns an *http.Client that makes requests which are subject to the |
| 1953 | // rate limit of your OAuth application. |