Reformat code
This commit is contained in:
@@ -70,13 +70,12 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Performs a GET request to the given endpoint.
|
/// Performs a GET request to the given endpoint.
|
||||||
Future<http.Response> get(
|
Future<http.Response> get(String endpoint, {bool isBinary = false}) async {
|
||||||
String endpoint, {
|
|
||||||
bool isBinary = false,
|
|
||||||
}) async {
|
|
||||||
final url = Uri.parse('$baseUrl$endpoint');
|
final url = Uri.parse('$baseUrl$endpoint');
|
||||||
final response =
|
final response = await http.get(
|
||||||
await http.get(url, headers: _buildHeaders(isBinary: isBinary));
|
url,
|
||||||
|
headers: _buildHeaders(isBinary: isBinary),
|
||||||
|
);
|
||||||
|
|
||||||
if (response.statusCode != 200) {
|
if (response.statusCode != 200) {
|
||||||
_log.warning(
|
_log.warning(
|
||||||
@@ -93,10 +92,7 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Performs a POST request with JSON body.
|
/// Performs a POST request with JSON body.
|
||||||
Future<http.Response> post(
|
Future<http.Response> post(String endpoint, Map<String, dynamic> body) async {
|
||||||
String endpoint,
|
|
||||||
Map<String, dynamic> body,
|
|
||||||
) async {
|
|
||||||
final url = Uri.parse('$baseUrl$endpoint');
|
final url = Uri.parse('$baseUrl$endpoint');
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
|
|||||||
Reference in New Issue
Block a user