Skip to content

HTTP integration

dart
import 'package:http/http.dart' as http;

void main() async {
  final response = await http.get(
    Uri.parse('https://api.apitube.io/v1/news/everything?limit=50&api_key=YOUR_API_KEY'),
  );

  if (response.statusCode == 200) {
    print(response.body);
  } else {
    print('Error: ${response.statusCode}');
  }
}