I'm creating a Flutter app and I'm trying to fetch my dummy data [from this endpoint](http://www.json-generator.com/api/json/get/cqKhaRYIKq?indent=2). I wanted to print the response data but my problem is upon fetching the API, the Content-Type is text/html instead of application/json. I'm using the HTTP package.

here's the [error](https://i.stack.imgur.com/be95x.png)

here's my code method 
for **base\_api.dart**

```
Future<MODEL> getAll() async {
  Map<String, String> headers = {"Content-type": "application/json"};
  final result = await http.get(url, headers: headers);
  print("Content type: ${result.headers['content-type']}");
  if (result.statusCode >= 200 && result.statusCode < 300 ) {
     return json.decode(result.body);
  } else {
     return json.decode(null);
  }                                                                                         
}

```

and here's my code in **services.dart**

```
Future loadUserTimeLogs() async {
  var userRepo = UserRepository();
  userRepo.getAll().then((val) {
    print("GET VAL: $val");
  }); }                                                                                  

```

and here's my **base\_repository.dart**

```
Future getAll({String query}) {
 var completer = Completer();
 api.getAll().then((val) {
 if (val == null) {
    completer.complete(dao.getAll());
 } else {
    completer.complete(val);
 }
 });                                                                                     
 return completer.future;
}

```