import 'dart:convert';
import 'dart:io';
import 'dart:async';


import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import 'package:path/path.dart';
import 'package:injector/injector.dart';

abstract class IHttpService {
  Future<Response> post(url,
      {Map<String, String> headers, body, Encoding encoding});

  Future<Response> get(url, {Map<String, String> headers});

  Future<Response> delete(url, {Map<String, String> headers});
}

class HttpService implements IHttpService {
  @override
  Future<Response> delete(url, {Map<String, String>? headers}) {
    return http.delete(url, headers: headers);
  }

  @override
  Future<Response> get(url, {Map<String, String>? headers}) {
    return http.get(url, headers: headers);
  }

  @override
  Future<Response> post(url,
      {Map<String, String>? headers, body, Encoding? encoding}) {
    return http.post(url, headers: headers, body: body, encoding: encoding);
  }
}
