http static method

OGCFeatureService http({
  1. required Uri endpoint,
  2. Client? client,
  3. Map<String, String>? headers,
  4. Map<String, String>? extraParams,
  5. TextReaderFormat<FeatureContent> format = GeoJSON.feature,
  6. Duration metaMaxAge = const Duration(minutes: 15),
})

A client for accessing OGC API Features compliant sources via http(s) conforming to format.

The required endpoint should refer to a base url of a feature service.

When given an optional client is used for http requests, otherwise the default client of the package:http/http.dart package is used (a new instance of default client for each service request). When client is given, this allows a client to better maintain persistent connections to a service, but it's also responsibility of a caller to close it appropriately.

When given headers are injected to http requests as http headers (however some can be overridden by the feature service implementation).

When given extraParams are injected to query part of http requests (however some can be overridden by the feature service implementation).

When format is not given, then GeoJSON with default settings is used as a default. Note that currently only GeoJSON is supported, but it's possible to inject another format implementation (or with custom configuration) to the default one.

metaMaxAge specifies a max age to cache metadata objects retrieved from a service and that are cached internally (in-memory) by this client.

Implementation

static OGCFeatureService http({
  required Uri endpoint,
  Client? client,
  Map<String, String>? headers,
  Map<String, String>? extraParams,
  TextReaderFormat<FeatureContent> format = GeoJSON.feature,
  Duration metaMaxAge = const Duration(minutes: 15),
}) =>
    _OGCFeatureClientHttp(
      endpoint,
      adapter: FeatureHttpAdapter(
        client: client,
        headers: headers,
        extraParams: extraParams,
      ),
      format: format,
      metaMaxAge: metaMaxAge,
    );