{"modulePath":"github.com/uber/submitqueue","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package http\n\nPackage http provides shared HTTP client helpers (e.g. base-URL transport) for code that calls external HTTP APIs.\n\n## Functions\n\n```go\nfunc NewClient(rawBaseURL string) (*nethttp.Client, error)\n```\nNewClient builds an \\*nethttp.Client with BaseURLTransport configured. Callers are responsible for layering additional transports (e.g. auth) and setting Timeout on the returned client.\n\n## Types\n\n```go\ntype BaseURLTransport struct {\n\t// BaseURL is the API base URL (e.g. \"https://api.github.com\").\n\tBaseURL *url.URL\n\t// Next is the underlying RoundTripper. Defaults to nethttp.DefaultTransport if nil.\n\tNext nethttp.RoundTripper\n}\n```\nBaseURLTransport is a nethttp.RoundTripper that rewrites every request URL to resolve against a fixed base URL. This allows callers to make requests with relative paths (e.g. \"/graphql\") and have the transport prepend the configured base URL transparently.\n\n```go\nfunc (t *BaseURLTransport) RoundTrip(req *nethttp.Request) (*nethttp.Response, error)\n```\nRoundTrip rewrites req.URL to resolve against BaseURL, then delegates to Next. The base URL path and request path are joined explicitly so that base URLs with a path component (e.g. \"[https://ghe.example.com/api](https://ghe.example.com/api)\") are handled correctly regardless of whether the request path starts with \"/\".\n\n","path":"github.com/uber/submitqueue/platform/http","name":"http","synopsis":"Package http provides shared HTTP client helpers (e.g.","isRedistributable":true}
