This curl works:
curl -XPOST http://192.168.1.14:12201/gelf -d ‘{“short_message”:“Hello there”, “host”:“example.org”, “facility”:“test”, “_foo”:“bar”}’
But using Dart and POSTing with HTTP returns status code 202:
import 'package:http/http.dart' as http;
Future<http.Response> createMessage() {
return http.post(
'http://192.168.1.14:12201/gelf',
body: {
'short_message': 'Hello there',
'host': 'example.org',
'facility': 'test',
'_foo': 'bar'
},
);
}
I don’t see any messages from the Dart code.