dependencies:
http: ^0.13.5
import 'package:flutter/rendering.dart';
import 'package:http/http.dart' as http;
void main() async {
// https://jsonplaceholder.typicode.com/todos/1
final httpsUri = Uri(
scheme: 'https',
host: 'jsonplaceholder.typicode.com',
path: 'todos/1');
var response = await http.get(httpsUri);
debugPrint('${response.statusCode}');
debugPrint(response.body);
}
import 'package:flutter/rendering.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
void main() async {
// https://jsonplaceholder.typicode.com/todos/1
final httpsUri = Uri(
scheme: 'https', host: 'jsonplaceholder.typicode.com', path: 'todos/1');
var response = await http.get(httpsUri);
debugPrint('${response.statusCode}');
debugPrint(response.body);
var data = jsonDecode(response.body);
debugPrint('userId : ${data['userId']}');
}