6
私は、ダーツのカールのような機能を得る最良の方法を探しています。たとえば、google.comのウェブコンテンツを取得して出力する方法を例として挙げます。ダートのカールのような機能
私はthe shell as shown hereを経由して、それを呼び出すことができることがわかった、しかしそれは理想的なアプローチのように見えるしていません:
import 'dart:io';
main() {
var f = new File(new Options().executable);
Process.start('curl',
['--dump-header', '/tmp/temp_dir1_M8KQFW/curl-headers', '--cacert',
'/Users/ager/dart/dart/third_party/curl/ca-certificates.crt', '--request',
'POST', '--data-binary', '@-', '--header', 'accept: ', '--header', 'user-agent: ' ,
'--header', 'authorization: Bearer access token', '--header',
'content-type: multipart/form-data', '--header',
'content-transfer-encoding: binary', '--header',
'content-length: ${f.lengthSync()}', 'http://localhost:9000/upload']).then((p) {
f.openInputStream().pipe(p.stdin);
p.stdout.pipe(stdout);
p.stderr.pipe(stderr);
p.onExit = (e) => print(e);
});
}
私はまた、APIを見て、ここで私を助けるために何かを見つけることができませんでした。