diff --git a/lib/src/matrix_api.dart b/lib/src/matrix_api.dart index d32e3524..4d623a0e 100644 --- a/lib/src/matrix_api.dart +++ b/lib/src/matrix_api.dart @@ -163,25 +163,25 @@ class MatrixApi { http.Response resp; var jsonResp = {}; try { - switch (describeEnum(type)) { - case 'GET': + switch (type) { + case RequestType.GET: resp = await httpClient.get(url, headers: headers).timeout( Duration(seconds: timeout), ); break; - case 'POST': + case RequestType.POST: resp = await httpClient.post(url, body: json, headers: headers).timeout( Duration(seconds: timeout), ); break; - case 'PUT': + case RequestType.PUT: resp = await httpClient.put(url, body: json, headers: headers).timeout( Duration(seconds: timeout), ); break; - case 'DELETE': + case RequestType.DELETE: resp = await httpClient.delete(url, headers: headers).timeout( Duration(seconds: timeout), );