On 2011-08-23 23:33, Walter Bright wrote:
On 8/17/2011 4:12 PM, David Nadlinger wrote:
the etc.curl module by Jonas Drewsen is at the front of the review queue.

Thanks for doing this. I preface my remarks with saying I have never
done http: programming and know little about it.

1. The first, most obvious thing I'd like to do is present a URL and get
a string back that is the contents of that web page:

string contents = getURL("http://www.digitalmars.com";);

and contents[] should be the web page; what I'd see if I opened it in a
browser and selected "view source". From perusing the etc.curl doc I
have absolutely no idea how to do this.

2. I'd like to get the contents as an input range, which I can then
iterate like any other range.

3. A lot of web sites like twitter.com have an API. How do I access that
API from D?

APIs like this, assuming they are RESTful APIs, are accessed via regular HTTP methods/verbs, like POST, GET, PUT, DELETE and so on. Your first example would be a GET request.

4. How do I download a file from ftp?

ubyte[] file = downloadFile("ftp://www.digitalmars.com/whatever.zip";);

5. I'd like an NNTP interface so I can get and post newsgroup messages
from D, though I suspect that is beyond the scope of etc.curl.


--
/Jacob Carlborg

Reply via email to