CancellableHttpLink constructor
CancellableHttpLink(
- String uri, {
- Map<
String, String> defaultHeaders = const {}, - bool useGETForQueries = false,
- RequestSerializer serializer = const RequestSerializer(),
- ResponseParser parser = const ResponseParser(),
- HttpResponseDecoder httpResponseDecoder = _defaultHttpResponseDecode,
- bool followRedirects = false,
Creates a new CancellableHttpLink.
uri is the endpoint of the GraphQL service.
defaultHeaders are HTTP headers included in every request.
useGETForQueries uses HTTP GET for query operations (not mutations).
serializer converts GraphQL requests to HTTP bodies.
parser converts HTTP response bodies to GraphQL responses.
httpResponseDecoder decodes HTTP response bytes to a Map.
followRedirects whether to follow HTTP redirects.
Implementation
CancellableHttpLink(
String uri, {
this.defaultHeaders = const {},
this.useGETForQueries = false,
this.serializer = const RequestSerializer(),
this.parser = const ResponseParser(),
this.httpResponseDecoder = _defaultHttpResponseDecode,
this.followRedirects = false,
}) : uri = Uri.parse(uri) {
_client = http.Client();
}