Saturday, February 14, 2015

List of methods and properties in Dart HttpClient class.

Some notes of Dart HttpClient class for to help implementing, hacking it.

https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:io.HttpClient
Tutorial:   https://www.dartlang.org/docs/tutorials/httpserver/
Write HTTP Clients & Servers.
This is meant to quicly be copied for to get needed parts of client, and delete others.
Warning: in editor this brings errors, 'cos missing elements; host, port, path, url, uri, realm aso.
I might do other posting of these, with full explanation of usage instructions.
Material is pasted directly from DartEditors hints-window. Usage: Use this to build "show client properties" app, for to demonstrate your client.  Somebody surely already did it :)


void clientPlay() {      //  my wrapper function
                                   //  add parameters:  host, port, path, url, suri, realm aso.
  client.authenticate;
  client.authenticateProxy;

  client.autoUncompress;

  client.badCertificateCallback;
  client.badCertificateCallback( callback(X509Certificate, String, int) → bool)

  client.findProxy;
  client.findProxy( f(Uri) → String);

  client.hashCode;
  client.idleTimeout;

  client.maxConnectionsPerHost;

  client.runtimeType;
  client.userAgent;

  client.addCredentials(url, realm, credentials);

  client.addProxyCredentials(host, port, realm, credentials);
  client.close();

  client.delete(host, port, path);
  client.deleteUrl(url);

  client.get(host, port, path);
  client.getUrl(url);

  client.hashCode;

  client.head(host, port, path);
  client.headUrl(url);

  client.noSuchMethod(invocation);

  client.open(method, host, port, path)
  client.openUrl(method, url);

  client.patch(host, port, path);
  client.patchUrl(url);

  client.post(host, port, path)
  client.post(host, port, path);
  client.postUrl(url);

  client.put(host, port, path);
  client.putUrl(url);

  client.toString();

}

No comments:

Post a Comment