Код: Выделить всё
Future postingHeader(String endPoint, Map map) async{
var client = new http.Client();
try {
Map headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/x-www-form-urlencoded",
"Access-Control-Allow-Origin": "*"};
final response1 = await http.head(Uri.parse(endPoint));
http.Response response = await client.post(
Uri.parse(endPoint),
headers: headers,
body: map,// Form input items
);
Map rest = json.decode(response.body);
return rest;
} finally{
client.close();
}
}
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/79362834/i-have-created-and-endpoint-in-php-for-a-flutter-app-but-recently-i-am-not-getti[/url]
Мобильная версия