mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
List Repos: Print the http req as curl
Makes it easier to test
This commit is contained in:
@ -2,11 +2,13 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart' as foundation;
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'package:gitjournal/utils.dart';
|
||||
import 'package:gitjournal/utils/logger.dart';
|
||||
import 'githost.dart';
|
||||
|
||||
@ -88,6 +90,10 @@ class GitHub implements GitHost {
|
||||
HttpHeaders.authorizationHeader: _buildAuthHeader(),
|
||||
};
|
||||
|
||||
if (foundation.kDebugMode) {
|
||||
print(toCurlCommand(url, headers));
|
||||
}
|
||||
|
||||
var response = await http.get(url, headers: headers);
|
||||
if (response.statusCode != 200) {
|
||||
Log.d("Github listRepos: Invalid response " +
|
||||
|
Reference in New Issue
Block a user