http | Dart Package

PHOTO EMBED

Fri Apr 01 2022 16:21:22 GMT+0000 (UTC)

Saved by @zbahadir #dart

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

var url = Uri.parse('https://example.com/whatsit/create');
var response = await http.post(url, body: {'name': 'doodle', 'color': 'blue'});
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');

print(await http.read(Uri.parse('https://example.com/foobar.txt')));
content_copyCOPY

https://pub.dev/packages/http