Handy API examples for HTTP requests

Adam D. Ruppe destructionator at gmail.com
Fri May 27 16:01:45 PDT 2011


My D curl wrapper (hopefully soon to be obsolete by a std.curl thing)
does it this way:

string response = curl(url); // does a GET on the url

string response = curl(url, some_post_data); // does a POST

string response = curl(url, some_post_data, post_content_type); // POST with a
special content type

string response = curlAuth(url, null, username, password); // auth GET

 = curlAuth(url, some_post_data, username, password); // authed POST



That way, most common scenarios are handled by very simple calls.


More information about the Digitalmars-d mailing list