My favorites | Sign in
Project Home Wiki Issues Source Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 6984 attachment: curl.dart (819 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
});
}
Powered by Google Project Hosting