Curl support RFC

Jesse Phillips jessekphillips+D at gmail.com
Fri Mar 11 13:21:33 PST 2011


I'll make some comments on the API. Do we have to choose Http/Ftp...? The URI already contains this, I could see being able to specifically request one or the other for performance or so www.google.com works.

And what about properties? They tend to be very nice instead of set methods. examples below.

Jonas Drewsen Wrote:

> //
> // Simple HTTP GET with sane defaults
> // provides the .content, .headers and .status
> //
> writeln( Http.get("http://www.google.com").content );
> 
> //
> // GET with custom data receiver delegates
> //
> Http http = new Http("http://www.google.dk");
> http.setReceiveHeaderCallback( (string key, string value) {
> 	writeln(key ~ ":" ~ value);
> } );
> http.setReceiveCallback( (string data) { /* drop */ } );
> http.perform;

http.onHeader = (string key, string value) {...};
http.onContent = (string data) { ... };
http.perform();


More information about the Digitalmars-d mailing list