post method
Implementation
Future<http.Response> post(
String ip,
String path, {
Map<String, String>? headers,
Map<String, dynamic>? body,
}) async {
final myIp = await client.getCurrentIp();
if (myIp == null) {
throw StateError('missing client IP');
}
final binding = await DeviceRequestBindingModel.create(
clientIp: myIp,
serverIp: ip,
method: 'POST',
path: path,
);
return client.post(
ip,
path,
headers: {
'Content-Type': 'application/json',
...?headers,
...binding.toHeaders(),
},
body: body,
);
}