title: Curl like functionality in Dart
body: <p>I'm looking for the best way to get curl-like functionality in Dart. For example, how to fetch the google.com web content and output it, as an example.</p>
  
  <p>I found that I can call it via <a href="http://code.google.com/p/dart/issues/attachmentText?id=6984&amp;aid=69840008000&amp;name=curl.dart&amp;token=49_7n_9DGsHcwaATwtkGhaGEpno:1354806458937" rel="noreferrer">the shell as shown here</a>, however that doesn't seem like the ideal approach:</p>
  
  <pre class="lang-dart prettyprint-override"><code>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) =&gt; print(e);
    });
  }
  </code></pre>
  
  <p>I also looked at the API and could not find anything to help me here. </p>