「Flutter/HttpRequest」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==httpリクエストサンプル== <pre> import 'package:http/http.dart' as http; String _targetUrl = "https://example.com/api/hoge?id=10"; String response_body = await...」) |
|||
行2: | 行2: | ||
<pre> | <pre> | ||
import 'package:http/http.dart' as http; | import 'package:http/http.dart' as http; | ||
− | String _targetUrl = " | + | String _targetUrl = "ttps://example.com/api/hoge?id=10"; |
String response_body = await http.read(_targetUrl); | String response_body = await http.read(_targetUrl); | ||
</pre> | </pre> | ||
+ | |||
+ | ==urlエンコード== | ||
+ | "ttp://example.com/api/hoge?body=" + Uri.encodeComponent("本文1") |
2019年12月21日 (土) 01:09時点における版
httpリクエストサンプル
import 'package:http/http.dart' as http; String _targetUrl = "ttps://example.com/api/hoge?id=10"; String response_body = await http.read(_targetUrl);
urlエンコード
"ttp://example.com/api/hoge?body=" + Uri.encodeComponent("本文1")