SanityClient constructor
SanityClient(
- SanityConfig config, {
- Client? httpClient,
- UrlBuilder? urlBuilder,
Creates a new Sanity client with the provided configuration. Use the optional parameters to provide a custom HTTP client or URL builder.
Implementation
SanityClient(
this.config, {
final http.Client? httpClient,
final UrlBuilder? urlBuilder,
}) : httpClient = httpClient ?? http.Client(),
urlBuilder = urlBuilder ?? SanityUrlBuilder(config),
_requestHeaders = {'Authorization': 'Bearer ${config.token}'};