getFavicon method

Future<Response> getFavicon({
  1. required String url,
})

Get Favicon

Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.

Implementation

Future<req.Response> getFavicon({required String url}) {
  final String path = '/avatars/favicon';

  final Map<String, dynamic> params = {
    'url': url,
    'project': client.config['project'],
  };

  params.keys.forEach((key) {
    if (params[key] is int || params[key] is double) {
      params[key] = params[key].toString();
    }
  });

  return client.call(HttpMethod.get,
      path: path, params: params, responseType: dio.ResponseType.bytes);
}