add digest, http_test

This commit is contained in:
2020-02-09 23:30:28 +08:00
parent 1d732537be
commit 9f8a7ccc59
4 changed files with 38 additions and 0 deletions

8
http_test/pubspec.yaml Normal file
View File

@@ -0,0 +1,8 @@
name: http_test
description: http test
dependencies:
http: ^0.12.0+2

13
http_test/ss.dart Normal file
View File

@@ -0,0 +1,13 @@
import 'package:http/http.dart' as http;
main() async {
var url = 'https://hatter.ink/ip/ip.jsonp';
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('https://hatter.ink/ip/ip.jsonp'));
}