NewHTTPTransport creates a new HTTP transport
(host, url string, rt http.RoundTripper)
| 27 | |
| 28 | // NewHTTPTransport creates a new HTTP transport |
| 29 | func NewHTTPTransport(host, url string, rt http.RoundTripper) *client.Runtime { |
| 30 | // TODO: apply the changes made by Boyan here, as after the update of the dependencies the changes are not available |
| 31 | transport := client.New(host, url, schemes) |
| 32 | transport.Consumers["text/html"] = runtime.TextConsumer() |
| 33 | |
| 34 | // Wrap the RoundTripper with User-Agent support |
| 35 | userAgentTransport := NewUserAgentTransport(rt) |
| 36 | transport.Transport = userAgentTransport |
| 37 | |
| 38 | jar, _ := cookiejar.New(nil) |
| 39 | transport.Jar = jar |
| 40 | return transport |
| 41 | } |
no test coverage detected