Make HTTP request without cURL/other libraries

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 24 09:58:33 PDT 2014


On Wednesday, 24 September 2014 at 16:45:57 UTC, BoPoHa_C_CblPoM 
wrote:
> I just want to make request. Now i use cURL and his "get(url)" 
> function.
> I want to make app smaller in size and in a single executable.
>
> I need a good example for using std.socket. I read httpget.d 
> from samples folder, but i can't understand it.

The first 366 lines of this file do it with just std.socket and 
optionally openssl:
https://github.com/adamdruppe/arsd/blob/master/http.d

The code is more complex than the samples folder thing but you 
can just copy/paste that portion into your program and use the

string html = get("http://mysie.com/page");

function to run it


More information about the Digitalmars-d mailing list