import 'package:http/http.dart';
import 'model_post.dart';
class PostService {
Future<List<Post>> getPosts() async {
print('DEBUGGING: x');
//Response response = await get("https://jsonplaceholder.typicode.com/posts"); // Works fine.
Response response = await get("https://delicate-river-096e.flutter-apps.workers.dev"); // Hangs up!!!
print('Response status: ${response.statusCode}');
}
}
Running "flutter pub get" in http_alex...
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
Debug service listening on ws://127.0.0.1:33451/q_w1rk9eLZk=/ws
Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Debug service listening on ws://127.0.0.1:33451/q_w1rk9eLZk=/ws
DEBUGGING: x
Hi,
The URL https://delicate-river-096e.flutter-apps.workers.dev returns exactly the same valid JSON copied from https://jsonplaceholder.typicode.com/posts.
Why does it not work?
I tried it with a lot of others hosts, but with the same result.
Very strang behavior. I despair, hope anybody can help me?
Thank you in advance.
Alex
question from:
https://stackoverflow.com/questions/65889810/http-get-hangs-up 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…