I am trying to send some data from Dart to PHP ... This is the code that I use to send data from Dart:
button.onClick.listen((e) {
var req = new HttpRequest();
req.onReadyStateChange.listen((HttpRequestProgressEvent e) {
if (req.readyState == HttpRequest.DONE) {
print('Data submitted!');
}
});
req.open('POST', form.action);
req.send('hello from dart');
});
In my PHP file, I am trying to use a string that I sent from dart, but count ($ _ POST) returns 0. $ _POST seems empty ...
The dart code launches a php script and displays "Data Submitted" ...
source
share