Skip to content

Commit f78c8a6

Browse files
committed
Pass a URI to package:http API
Updates example to be forwards compatible with the breaking change in dart-lang/http#507
1 parent 7c6dac4 commit f78c8a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/docs/cookbook/networking/fetch-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ import 'package:http/http.dart' as http;
242242
243243
Future<Album> fetchAlbum() async {
244244
final response =
245-
await http.get('https://jsonplaceholder.typicode.com/albums/1');
245+
await http.get(Uri.https('jsonplaceholder.typicode.com', 'albums/1');
246246
247247
if (response.statusCode == 200) {
248248
// If the server did return a 200 OK response,

0 commit comments

Comments
 (0)