AllUCanGET: a HTTP client Dlang library


AllUCanGET is a HTTP client library written in D programming language.

With AllUCanGET you can easy implement the HTTP communication from your client application written in D language. With this library your application can easy send the request to the HTTP server and you will have the result simply returned as a string.

The main features are:
Requirements:
Usage on Windows:
dmd httpclient.d allucanget.lib -I.\import\

Usage on Linux:
dmd httpclient.d -I./import/ -L-L/home/YourAppSrcDir -L-lssl -L-lcrypto -L-lallucanget -L-ldl

Usage in D:
module httpclient;

import std.string;
import std.stdio;
import std.socket;

version(Windows)
{
	pragma(lib, "allucanget");
}
version(linux)
{
	pragma(lib, "ssl");
	pragma(lib, "crypto");
	pragma(lib, "allucanget");
}

import allucanget.allucanget;

int main()
{
	auto httpclient=new AllUCanGET;

	httpclient.url="http://testdomain.com/";
	httpclient.referer="http://allucanget.diaboli.pl";
	httpclient.accept="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
	httpclient.acceptlanguage="pl,en-US;q=0.7,en;q=0.3";
	httpclient.acceptencoding="gzip, deflate";
	httpclient.cookies="testcookie1=value1&testcookie2=value2";
	httpclient.post=1; //0: GET, 1: POST.
	httpclient.postdata="postfield1=value1&postfield2=value2";
	httpclient.dnt=1; //0: DNT header field is not sent, 1: DNT header field is sent.
	httpclient.maxredirects=10; //Maximum count of automatic redirects. If is set to 0, it won't follow the location header.
	httpclient.verbose=1; //0: Quiet mode, 1: shows http request, 2: shows http request and server response.

	httpclient.allucanget();
	writeln(httpclient.response["header"]);
	writeln(httpclient.response["efective_url"]);
	writeln(httpclient.response["body"]);
	writeln(httpclient.response["http_code"]); //Values 6xx means internal AllUCanGet library error codes

	return 0;
}
Download AllUCanGet ver. 0.1:
License:
Contact:
Other links:
© allucanget.diaboli.pl