支付宝赞助帐号:service@kuitao8.com 

flutter http post基础用法

Created2020-02-21   Views 499    Author 懒人程序
import 'package:http/http.dart' as http;

Map data = {
  'key1': 1,
  'key2': "some text"
}

String body = json.encode(data);

http.Response response = await http.post(
  url: 'https://example.com',
  headers: {"Content-Type": "application/json"},
  body: body,
);
上一篇: flutter用浏览器打开网址
下一篇: flutter下拉展开
支持键盘 ← →

邮件订阅

订阅我们的精彩内容