get method

Future<String> get({
  1. required String url,
  2. required Map<String, String> headers,
  3. required Client? httpClient,
})

run executable telegram bot api

Implementation

Future<String> get({
  required String url,
  required Map<String, String> headers,
  required http.Client? httpClient,
}) async {
  httpClient ??= http_client;
  var uri = Uri.parse(url);
  headers["cookie"] = cookies;
  final response = await httpClient.get(uri, headers: headers);
  if (response.headers["set-cookie"] != null) {
    cookies = '${cookies}${response.headers["set-cookie"]!};';
  }
  return response.body;
}